instructure / pandarus

A Ruby library for the Canvas API (and code generator for other languages, eventually)
34 stars 24 forks source link

No analytics? #12

Closed austinmbrown closed 7 years ago

austinmbrown commented 9 years ago

It looks like the analytics section of the API (https://canvas.instructure.com/doc/api/analytics.html) isn't built into the gem - am I missing something? I'm using 0.6.6, so I'm pretty sure I'm up to date.

eriko commented 9 years ago

That does seem correct. I wonder if there is something odd about that part the prevents swagger from processing it?

eriko commented 9 years ago

It does show up in the live api which is I think based on the same code generation back end. https://YOUR.CANVAS.DOMAIN/doc/api/live#!/analytics.json

austinmbrown commented 9 years ago

I cloned the gem and tried to build it locally just to see what's up, but I don't know what any of these errors are about. Do I need to build the gem inside a canvas installation or something?

Here's what I got:

/Users/austinbrown/code/pandarus
rm -f ./clients/ruby/lib/pandarus/models/*.rb
+ mvn clean package scala:run -Dlauncher=ruby-codegen
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building client-generator 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ client-generator ---
[INFO] Deleting /Users/austinbrown/code/pandarus/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ client-generator ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/austinbrown/code/pandarus/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ client-generator ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- scala-maven-plugin:3.1.0:compile (default) @ client-generator ---
[INFO] /Users/austinbrown/code/pandarus/codegen/src:-1: info: compiling
[INFO] Compiling 1 source files to /Users/austinbrown/code/pandarus/target/classes at 1433352612769
[ERROR] error: error while loading CharSequence, class file '/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/rt.jar(java/lang/CharSequence.class)' is broken
[INFO] (bad constant pool tag 18 at byte 10)
[ERROR] /Users/austinbrown/code/pandarus/codegen/src/RubyCanvasCodegen.scala:46: error: overloaded method value replace with alternatives:
[ERROR]   (java.lang.CharSequence,java.lang.CharSequence)java.lang.String <and>
[ERROR]   (Char,Char)java.lang.String
[ERROR]  cannot be applied to (java.lang.String, java.lang.String)
[ERROR]       replace("-", "_").
[ERROR]       ^
[ERROR] two errors found
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.057 s
[INFO] Finished at: 2015-06-03T13:30:16-04:00
[INFO] Final Memory: 12M/225M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.1.0:compile (default) on project client-generator: wrap: org.apache.commons.exec.ExecuteException: Process exited with an error: 1(Exit value: 1) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
eriko commented 9 years ago

If I remember correctly from when I got it to build (I normally just use the gem) you need companion canvas-lms checkout next to it. That said in looking at the code there should be models for analytics here https://github.com/instructure/pandarus/tree/master/clients/ruby/lib/pandarus/models but there are not which makes me think that @canadaduane has not finished that part yet.

austinmbrown commented 9 years ago

That makes sense. Thanks!

@canadaduane - any insights about getting analytics into this gem you can provide would be appreciated :)

simonista commented 7 years ago

Added in 531a53ea26653bac9f2898046111889c7f2fa004