gooddata 0.6.0.pre9 → 0.6.0.pre10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. data/.gitignore +3 -0
  2. data/.rspec +3 -0
  3. data/.yardopts +19 -0
  4. data/Gemfile +5 -0
  5. data/README.md +191 -0
  6. data/Rakefile +18 -1
  7. data/bin/gooddata +74 -63
  8. data/doc/.gitignore +1 -0
  9. data/doc/css/.gitkeepme +1 -0
  10. data/doc/images/.gitkeepme +1 -0
  11. data/doc/images/background.png +0 -0
  12. data/doc/images/bg-callout-button.png +0 -0
  13. data/doc/images/header-logo.png +0 -0
  14. data/doc/images/logo-image.png +0 -0
  15. data/doc/js/.gitkeepme +1 -0
  16. data/doc/pages/GET_STARTED.md +309 -0
  17. data/doc/pages/HOMEPAGE.md +75 -0
  18. data/doc/pages/TUTORIALS.md +52 -0
  19. data/doc/pages/tutorial/BRICKS.md +257 -0
  20. data/doc/pages/tutorial/CREATING_A_MODEL.md +79 -0
  21. data/doc/pages/tutorial/CRUNCHING_NUMBERS.md +233 -0
  22. data/doc/pages/tutorial/TEST_DRIVEN_DEVELOPMENT.md +118 -0
  23. data/doc/pages/tutorial/YOUR_FIRST_PROJECT.md +52 -0
  24. data/doc/templates/default/class/dot/setup.rb +6 -0
  25. data/doc/templates/default/class/dot/superklass.erb +3 -0
  26. data/doc/templates/default/class/setup.rb +36 -0
  27. data/doc/templates/default/class/text/setup.rb +11 -0
  28. data/doc/templates/default/class/text/subclasses.erb +5 -0
  29. data/doc/templates/default/constant/text/header.erb +11 -0
  30. data/doc/templates/default/constant/text/setup.rb +3 -0
  31. data/doc/templates/default/docstring/setup.rb +51 -0
  32. data/doc/templates/default/docstring/text/abstract.erb +2 -0
  33. data/doc/templates/default/docstring/text/deprecated.erb +2 -0
  34. data/doc/templates/default/docstring/text/index.erb +2 -0
  35. data/doc/templates/default/docstring/text/note.erb +4 -0
  36. data/doc/templates/default/docstring/text/private.erb +2 -0
  37. data/doc/templates/default/docstring/text/returns_void.erb +1 -0
  38. data/doc/templates/default/docstring/text/text.erb +1 -0
  39. data/doc/templates/default/docstring/text/todo.erb +4 -0
  40. data/doc/templates/default/layout/dot/header.erb +6 -0
  41. data/doc/templates/default/layout/dot/setup.rb +14 -0
  42. data/doc/templates/default/method/setup.rb +3 -0
  43. data/doc/templates/default/method/text/header.erb +1 -0
  44. data/doc/templates/default/method_details/setup.rb +10 -0
  45. data/doc/templates/default/method_details/text/header.erb +10 -0
  46. data/doc/templates/default/method_details/text/method_signature.erb +12 -0
  47. data/doc/templates/default/method_details/text/setup.rb +10 -0
  48. data/doc/templates/default/module/dot/child.erb +1 -0
  49. data/doc/templates/default/module/dot/dependencies.erb +3 -0
  50. data/doc/templates/default/module/dot/header.erb +6 -0
  51. data/doc/templates/default/module/dot/info.erb +14 -0
  52. data/doc/templates/default/module/dot/setup.rb +14 -0
  53. data/doc/templates/default/module/setup.rb +164 -0
  54. data/doc/templates/default/module/text/children.erb +10 -0
  55. data/doc/templates/default/module/text/class_meths_list.erb +8 -0
  56. data/doc/templates/default/module/text/extends.erb +8 -0
  57. data/doc/templates/default/module/text/header.erb +7 -0
  58. data/doc/templates/default/module/text/includes.erb +8 -0
  59. data/doc/templates/default/module/text/instance_meths_list.erb +8 -0
  60. data/doc/templates/default/module/text/setup.rb +12 -0
  61. data/doc/templates/default/root/dot/child.erb +3 -0
  62. data/doc/templates/default/root/dot/setup.rb +5 -0
  63. data/doc/templates/default/tags/setup.rb +55 -0
  64. data/doc/templates/default/tags/text/example.erb +12 -0
  65. data/doc/templates/default/tags/text/index.erb +1 -0
  66. data/doc/templates/default/tags/text/option.erb +20 -0
  67. data/doc/templates/default/tags/text/overload.erb +19 -0
  68. data/doc/templates/default/tags/text/see.erb +11 -0
  69. data/doc/templates/default/tags/text/tag.erb +13 -0
  70. data/examples.rb +2 -2
  71. data/gooddata.gemspec +31 -26
  72. data/lib/gooddata/bricks/middleware/gooddata_middleware.rb +1 -1
  73. data/lib/gooddata/client.rb +65 -53
  74. data/lib/gooddata/commands/commands.rb +9 -0
  75. data/lib/gooddata/commands/process.rb +9 -8
  76. data/lib/gooddata/commands/projects.rb +29 -0
  77. data/lib/gooddata/commands/runners.rb +1 -1
  78. data/lib/gooddata/connection.rb +6 -4
  79. data/lib/gooddata/exceptions.rb +2 -1
  80. data/lib/gooddata/helpers.rb +1 -1
  81. data/lib/gooddata/model.rb +360 -189
  82. data/lib/gooddata/models/metadata.rb +1 -1
  83. data/lib/gooddata/models/metric.rb +2 -1
  84. data/lib/gooddata/models/project.rb +1 -1
  85. data/lib/gooddata/models/report.rb +0 -18
  86. data/lib/gooddata/version.rb +1 -1
  87. data/spec/blueprint_spec.rb +83 -43
  88. data/spec/data/additional_dataset_module.json +18 -0
  89. data/spec/data/blueprint_invalid.json +36 -0
  90. data/spec/data/blueprint_valid.json +37 -0
  91. data/spec/data/model_module.json +18 -0
  92. data/spec/{test_project_model_spec.json → data/test_project_model_spec.json} +4 -0
  93. data/spec/full_project_spec.rb +4 -3
  94. data/spec/helpers/blueprint_helper.rb +17 -0
  95. data/spec/merging_blueprints_spec.rb +23 -48
  96. data/spec/model_dsl_spec.rb +2 -2
  97. data/spec/model_spec.rb +44 -0
  98. data/spec/project_build_and_update_spec.rb +28 -0
  99. data/spec/spec_helper.rb +6 -0
  100. data/yard-server.sh +3 -0
  101. metadata +251 -74
  102. data/README.rdoc +0 -176
@@ -1,176 +0,0 @@
1
- = GoodData Ruby wrapper and CLI
2
-
3
- A convenient Ruby wrapper around the GoodData RESTful API. The gem comes in two flavors. It has a CLI client and it is a library whch you can integrate into your application.
4
-
5
- The best documentation for the GoodData API can be found using these resources:
6
- * http://docs.gooddata.apiary.io/
7
- * http://developer.gooddata.com/api
8
- * https://secure.gooddata.com/gdc
9
-
10
- == Install
11
-
12
- If you are using bundler. Add
13
-
14
- gem "gooddata"
15
-
16
- into Gemfile
17
-
18
- and run
19
-
20
- bundle install
21
-
22
- If you are using gems just
23
-
24
- gem install gooddata
25
-
26
- === Library usage
27
-
28
-
29
- In its most simple form GoodData gem just cares about the logging in and juggling the tokens that are needed for you to retrive information. It provides you the usual HTTP methods that you are used to. Couple of examples.
30
-
31
- ==== Authentiacation
32
-
33
- GoodData.connect("login", "pass")
34
-
35
- # Different server than the usual secure.gooddata.com
36
- GoodData.connect("login", "pass", "https://different.server.gooddata.com")
37
-
38
- # the last argument is passed to underlying RestClient so you can specify other useful stuff there
39
- GoodData.connect("login", "pass", "https://different.server.gooddata.com", :timeout => 0)
40
-
41
- ==== Basic requests
42
-
43
- GoodData.get("/gdc/md")
44
-
45
- # This post will not actually work it is just for the illustration
46
- GoodData.post("/gdc/md/#{project_id}", {:my_object => "some_date"})
47
-
48
- # and the same goes for put delete
49
- # By default the response is decoded for you as json but sometimes you do not want that png or other stuff.
50
- # you will get the response object and you can query it further
51
- response = GoodData.get("/gdc/md", :process => false)
52
- response.code == 400
53
- pp response.body
54
-
55
- ==== Loading of data
56
-
57
- This library is able to load data but it is not used that much if at all. Since there is some data processing needed on the client side we rely on faster implementations in Java usually. Let us know if you would be interested. As the APIs improve we could bring it back.
58
-
59
- ==== Other stuff
60
- The API is currently a little fragmented and we never had the guts to actually deal with all the ugliness and present nice object oriented API. Usually it is just better to deal with the ugly json as hashes. But there are couple of exceptions where we needed something better and we thought providing an abstraction is worth the hassle.
61
-
62
- ==== Working with obj
63
-
64
- obj is a resource that is probably the oldest in all GoodData. Obj are all the objects that have something to do with the analytical engine (metrics, attributes, reports etc). You can find the docs here (Add link to apiary). There are coule of convenience methods to work with these
65
-
66
- GoodData.connect("svarovsky@gooddata.com", "just_testing")
67
- GoodData.project="fill_in_your_project_pid"
68
-
69
- obj = GoodData::MdObject[obj_number]
70
- # bunch of useful methods are defined on these
71
- obj.title
72
- obj.get_used_by
73
- obj.get_using
74
- obj.delete
75
-
76
- ==== Working with reports
77
- Sometimes it is useful to compute reports outside of UI so there are couple of convenience methods for that.
78
-
79
- require 'pp'
80
-
81
- GoodData.connect("svarovsky@gooddata.com", "just_testing")
82
- GoodData.project="fill_in_your_project_pid"
83
-
84
- report = GoodData::Report[1231]
85
- result = report.execute
86
- pp result
87
-
88
- File.open('png.png', 'w') do |f|
89
- f.write(report.export(:png))
90
- end
91
-
92
- You can export even whole dashboards. Currently afaik reports can be exported either as xls and png and dashboards as pdf. Hopefully it will support more in the future.
93
-
94
- dash = GoodData::Dashboard[33807]
95
- File.open('dash.pdf', 'w') do |f|
96
- f.write(dash.export(:pdf))
97
- end
98
-
99
- You can specify which tab to export. By default it is the first
100
-
101
- dash = GoodData::Dashboard[33807]
102
- File.open('dash.pdf', 'w') do |f|
103
- f.write(dash.export(:pdf, :tab => dash.tabs_ids.last))
104
- end
105
-
106
- === CLI Usage
107
-
108
- After installing the gooddata gem, GoodData is available from your command line using
109
- the <tt>gooddata</tt> command. To get a complete overview of possible options type:
110
-
111
- gooddata help
112
-
113
- The examples and descriptions below does not cover all the options available via the CLI.
114
- So remember to refer back to the <tt>help</tt> command.
115
-
116
- Before you do anything else, a good idea is to see if your account is set up correctly and
117
- that you can log in. To do this, use the <tt>api:test</tt> command:
118
-
119
- gooddata api:test
120
-
121
- ==== Authentication
122
-
123
- As you saw if you ran the above test command <tt>gooddata</tt> will prompt you
124
- for your GoodData username and password. If you don't wish to write your
125
- credentials each time you connect to GoodData using <tt>gooddata</tt>, you can
126
- create a simple gooddata credentials file called <tt>.gooddata</tt> in the root
127
- of your home directory. To make it easy you can just run the credentials file
128
- generator command which will create the file for you:
129
-
130
- gooddata auth:store
131
-
132
- ==== List available projects
133
-
134
- To get a list of projects available to your GoodData user account, run:
135
-
136
- gooddata projects
137
-
138
- The output from the above command will look similar to this:
139
-
140
- 521 Some project
141
- 3521 Some other project
142
- 3642 Some third project
143
-
144
- The first column contains the project-key. You need this if you wan't to either
145
- see more details about the project using the <tt>projects:show</tt> comamnd or
146
- if you wish to delete the project using the <tt>projects:delete</tt> command.
147
-
148
- ==== Create a new project
149
-
150
- To create a new project under on the GoodData servers, run:
151
-
152
- gooddata projects:create
153
-
154
- You will then be asked about the desired project name and summary before it's created.
155
-
156
- == Note on Patches/Pull Requests
157
-
158
- * Fork the project.
159
- * Make your feature addition or bug fix.
160
- * Add tests for it. This is important so I don't break it in a
161
- future version unintentionally.
162
- * Commit, do not mess with rakefile, version, or history.
163
- (if you want to have your own version, that is fine but bump version in a commit by itself we can ignore when we pull)
164
- * Send us a pull request. Bonus points for topic branches.
165
-
166
- == Credits
167
-
168
- This project is developed and maintained by Pavel Kolesnikov [ mailto:pavel@gooddata.com
169
- / {@koles}[http:/twitter.com/koles] ] and Tomas Svarovsky [mailto:svarovsky.tomas@gmail.com]
170
-
171
- Special thanks to Thomas Watson Steen [ mailto:w@tson.dk /
172
- {@wa7son}[http://twitter.com/wa7son] ]
173
-
174
- == Copyright
175
-
176
- Copyright (c) 2010 - 2011 GoodData Corporation and Thomas Watson Steen. See LICENSE for details.