gooddata 0.6.20 → 0.6.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -1
  3. data/DEPENDENCIES.md +816 -0
  4. data/LICENSE +1 -1
  5. data/LICENSE.rb +5 -0
  6. data/Rakefile +74 -22
  7. data/dependency_decisions.yml +102 -0
  8. data/gooddata.gemspec +39 -38
  9. data/lib/gooddata.rb +4 -0
  10. data/lib/gooddata/app/app.rb +4 -0
  11. data/lib/gooddata/bricks/base_downloader.rb +5 -1
  12. data/lib/gooddata/bricks/brick.rb +4 -0
  13. data/lib/gooddata/bricks/bricks.rb +5 -0
  14. data/lib/gooddata/bricks/middleware/aws_middleware.rb +5 -0
  15. data/lib/gooddata/bricks/middleware/base_middleware.rb +5 -0
  16. data/lib/gooddata/bricks/middleware/bench_middleware.rb +5 -0
  17. data/lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb +5 -0
  18. data/lib/gooddata/bricks/middleware/decode_params_middleware.rb +6 -0
  19. data/lib/gooddata/bricks/middleware/fs_download_middleware.rb +6 -0
  20. data/lib/gooddata/bricks/middleware/fs_upload_middleware.rb +6 -0
  21. data/lib/gooddata/bricks/middleware/gooddata_middleware.rb +6 -0
  22. data/lib/gooddata/bricks/middleware/logger_middleware.rb +5 -0
  23. data/lib/gooddata/bricks/middleware/middleware.rb +5 -0
  24. data/lib/gooddata/bricks/middleware/restforce_middleware.rb +4 -0
  25. data/lib/gooddata/bricks/middleware/stdout_middleware.rb +5 -0
  26. data/lib/gooddata/bricks/middleware/twitter_middleware.rb +5 -0
  27. data/lib/gooddata/bricks/middleware/undot_params_middleware.rb +4 -0
  28. data/lib/gooddata/bricks/pipeline.rb +4 -0
  29. data/lib/gooddata/bricks/utils.rb +4 -0
  30. data/lib/gooddata/cli/cli.rb +4 -0
  31. data/lib/gooddata/cli/commands/api_cmd.rb +4 -0
  32. data/lib/gooddata/cli/commands/auth_cmd.rb +4 -0
  33. data/lib/gooddata/cli/commands/console_cmd.rb +4 -0
  34. data/lib/gooddata/cli/commands/domain_cmd.rb +4 -0
  35. data/lib/gooddata/cli/commands/process_cmd.rb +4 -0
  36. data/lib/gooddata/cli/commands/project_cmd.rb +4 -0
  37. data/lib/gooddata/cli/commands/projects_cmd.rb +4 -0
  38. data/lib/gooddata/cli/commands/run_ruby_cmd.rb +4 -0
  39. data/lib/gooddata/cli/commands/scaffold_cmd.rb +4 -0
  40. data/lib/gooddata/cli/commands/user_cmd.rb +4 -0
  41. data/lib/gooddata/cli/hooks.rb +4 -0
  42. data/lib/gooddata/cli/shared.rb +4 -0
  43. data/lib/gooddata/cli/terminal.rb +4 -0
  44. data/lib/gooddata/client.rb +4 -0
  45. data/lib/gooddata/commands/api.rb +4 -0
  46. data/lib/gooddata/commands/auth.rb +4 -0
  47. data/lib/gooddata/commands/base.rb +4 -0
  48. data/lib/gooddata/commands/commands.rb +5 -0
  49. data/lib/gooddata/commands/datasets.rb +5 -1
  50. data/lib/gooddata/commands/datawarehouse.rb +4 -0
  51. data/lib/gooddata/commands/domain.rb +4 -0
  52. data/lib/gooddata/commands/process.rb +4 -0
  53. data/lib/gooddata/commands/project.rb +7 -9
  54. data/lib/gooddata/commands/projects.rb +4 -0
  55. data/lib/gooddata/commands/role.rb +4 -0
  56. data/lib/gooddata/commands/runners.rb +4 -0
  57. data/lib/gooddata/commands/scaffold.rb +4 -0
  58. data/lib/gooddata/commands/user.rb +4 -0
  59. data/lib/gooddata/connection.rb +83 -0
  60. data/lib/gooddata/core/core.rb +4 -0
  61. data/lib/gooddata/core/logging.rb +4 -0
  62. data/lib/gooddata/core/nil_logger.rb +4 -0
  63. data/lib/gooddata/core/project.rb +4 -0
  64. data/lib/gooddata/core/rest.rb +14 -16
  65. data/lib/gooddata/core/user.rb +4 -0
  66. data/lib/gooddata/data/data.rb +4 -0
  67. data/lib/gooddata/data/guesser.rb +4 -0
  68. data/lib/gooddata/exceptions/attr_element_not_found.rb +4 -0
  69. data/lib/gooddata/exceptions/command_failed.rb +4 -0
  70. data/lib/gooddata/exceptions/exceptions.rb +4 -0
  71. data/lib/gooddata/exceptions/execution_limit_exceeded.rb +4 -0
  72. data/lib/gooddata/exceptions/filter_maqlization.rb +16 -0
  73. data/lib/gooddata/exceptions/malformed_user.rb +15 -0
  74. data/lib/gooddata/exceptions/no_project_error.rb +4 -0
  75. data/lib/gooddata/exceptions/object_migration.rb +28 -0
  76. data/lib/gooddata/exceptions/project_not_found.rb +5 -0
  77. data/lib/gooddata/exceptions/uncomputable_report.rb +5 -0
  78. data/lib/gooddata/exceptions/user_in_different_domain.rb +4 -0
  79. data/lib/gooddata/exceptions/validation_error.rb +4 -0
  80. data/lib/gooddata/extensions/big_decimal.rb +4 -0
  81. data/lib/gooddata/extensions/enumerable.rb +4 -0
  82. data/lib/gooddata/extensions/extensions.rb +4 -0
  83. data/lib/gooddata/extensions/false.rb +4 -0
  84. data/lib/gooddata/extensions/hash.rb +4 -0
  85. data/lib/gooddata/extensions/nil.rb +4 -0
  86. data/lib/gooddata/extensions/numeric.rb +4 -0
  87. data/lib/gooddata/extensions/object.rb +4 -0
  88. data/lib/gooddata/extensions/symbol.rb +4 -0
  89. data/lib/gooddata/extensions/true.rb +4 -0
  90. data/lib/gooddata/extract.rb +4 -0
  91. data/lib/gooddata/goodzilla/goodzilla.rb +87 -77
  92. data/lib/gooddata/helpers/auth_helpers.rb +6 -2
  93. data/lib/gooddata/helpers/csv_helper.rb +4 -0
  94. data/lib/gooddata/helpers/data_helper.rb +4 -0
  95. data/lib/gooddata/helpers/global_helpers.rb +35 -6
  96. data/lib/gooddata/helpers/global_helpers_params.rb +34 -7
  97. data/lib/gooddata/helpers/helpers.rb +4 -0
  98. data/lib/gooddata/mixins/author.rb +4 -0
  99. data/lib/gooddata/mixins/content_getter.rb +4 -0
  100. data/lib/gooddata/mixins/content_property_reader.rb +4 -0
  101. data/lib/gooddata/mixins/content_property_writer.rb +4 -0
  102. data/lib/gooddata/mixins/contributor.rb +4 -0
  103. data/lib/gooddata/mixins/data_getter.rb +4 -0
  104. data/lib/gooddata/mixins/data_property_reader.rb +4 -0
  105. data/lib/gooddata/mixins/data_property_writer.rb +4 -0
  106. data/lib/gooddata/mixins/inspector.rb +4 -0
  107. data/lib/gooddata/mixins/is_attribute.rb +4 -0
  108. data/lib/gooddata/mixins/is_dimension.rb +4 -0
  109. data/lib/gooddata/mixins/is_fact.rb +4 -0
  110. data/lib/gooddata/mixins/is_label.rb +4 -0
  111. data/lib/gooddata/mixins/links.rb +4 -0
  112. data/lib/gooddata/mixins/md_finders.rb +4 -0
  113. data/lib/gooddata/mixins/md_id_to_uri.rb +4 -0
  114. data/lib/gooddata/mixins/md_json.rb +4 -0
  115. data/lib/gooddata/mixins/md_lock.rb +4 -0
  116. data/lib/gooddata/mixins/md_object_id.rb +5 -1
  117. data/lib/gooddata/mixins/md_object_indexer.rb +4 -0
  118. data/lib/gooddata/mixins/md_object_query.rb +4 -0
  119. data/lib/gooddata/mixins/md_relations.rb +4 -0
  120. data/lib/gooddata/mixins/meta_getter.rb +4 -0
  121. data/lib/gooddata/mixins/meta_property_reader.rb +4 -0
  122. data/lib/gooddata/mixins/meta_property_writer.rb +4 -0
  123. data/lib/gooddata/mixins/mixins.rb +4 -0
  124. data/lib/gooddata/mixins/not_attribute.rb +4 -0
  125. data/lib/gooddata/mixins/not_exportable.rb +4 -0
  126. data/lib/gooddata/mixins/not_fact.rb +4 -0
  127. data/lib/gooddata/mixins/not_label.rb +4 -0
  128. data/lib/gooddata/mixins/not_metric.rb +6 -0
  129. data/lib/gooddata/mixins/obj_id.rb +4 -0
  130. data/lib/gooddata/mixins/rest_getters.rb +4 -0
  131. data/lib/gooddata/mixins/rest_resource.rb +4 -0
  132. data/lib/gooddata/mixins/root_key_getter.rb +4 -0
  133. data/lib/gooddata/mixins/root_key_setter.rb +4 -0
  134. data/lib/gooddata/mixins/timestamps.rb +4 -0
  135. data/lib/gooddata/models/blueprint/anchor_field.rb +4 -0
  136. data/lib/gooddata/models/blueprint/attribute_field.rb +4 -0
  137. data/lib/gooddata/models/blueprint/blueprint.rb +4 -0
  138. data/lib/gooddata/models/blueprint/blueprint_field.rb +4 -0
  139. data/lib/gooddata/models/blueprint/dashboard_builder.rb +4 -0
  140. data/lib/gooddata/models/blueprint/dataset_blueprint.rb +6 -0
  141. data/lib/gooddata/models/blueprint/date_dimension.rb +4 -0
  142. data/lib/gooddata/models/blueprint/fact_field.rb +4 -0
  143. data/lib/gooddata/models/blueprint/label_field.rb +4 -0
  144. data/lib/gooddata/models/blueprint/project_blueprint.rb +6 -0
  145. data/lib/gooddata/models/blueprint/project_builder.rb +4 -0
  146. data/lib/gooddata/models/blueprint/reference_field.rb +4 -0
  147. data/lib/gooddata/models/blueprint/schema_blueprint.rb +4 -0
  148. data/lib/gooddata/models/blueprint/schema_builder.rb +4 -0
  149. data/lib/gooddata/models/blueprint/to_manifest.rb +17 -1
  150. data/lib/gooddata/models/blueprint/to_wire.rb +4 -0
  151. data/lib/gooddata/models/datawarehouse.rb +5 -0
  152. data/lib/gooddata/models/domain.rb +25 -7
  153. data/lib/gooddata/models/execution.rb +4 -0
  154. data/lib/gooddata/models/execution_detail.rb +4 -0
  155. data/lib/gooddata/models/from_wire.rb +4 -0
  156. data/lib/gooddata/models/invitation.rb +4 -0
  157. data/lib/gooddata/models/links.rb +4 -0
  158. data/lib/gooddata/models/membership.rb +4 -0
  159. data/lib/gooddata/models/metadata.rb +37 -10
  160. data/lib/gooddata/models/metadata/attribute.rb +6 -0
  161. data/lib/gooddata/models/metadata/dashboard.rb +54 -16
  162. data/lib/gooddata/models/metadata/dashboard/dashboard_item.rb +60 -0
  163. data/lib/gooddata/models/metadata/dashboard/filter_item.rb +15 -0
  164. data/lib/gooddata/models/metadata/dashboard/report_item.rb +51 -0
  165. data/lib/gooddata/models/metadata/dashboard_tab.rb +88 -0
  166. data/lib/gooddata/models/metadata/dataset.rb +4 -0
  167. data/lib/gooddata/models/metadata/dimension.rb +4 -0
  168. data/lib/gooddata/models/metadata/fact.rb +6 -0
  169. data/lib/gooddata/models/metadata/label.rb +15 -0
  170. data/lib/gooddata/models/metadata/metadata.rb +4 -0
  171. data/lib/gooddata/models/metadata/metric.rb +5 -4
  172. data/lib/gooddata/models/metadata/report.rb +62 -16
  173. data/lib/gooddata/models/metadata/report_definition.rb +44 -47
  174. data/lib/gooddata/models/metadata/variable.rb +4 -0
  175. data/lib/gooddata/models/model.rb +85 -36
  176. data/lib/gooddata/models/models.rb +4 -0
  177. data/lib/gooddata/models/module_constants.rb +4 -0
  178. data/lib/gooddata/models/process.rb +4 -0
  179. data/lib/gooddata/models/profile.rb +13 -0
  180. data/lib/gooddata/models/project.rb +173 -92
  181. data/lib/gooddata/models/project_creator.rb +18 -10
  182. data/lib/gooddata/models/project_metadata.rb +4 -0
  183. data/lib/gooddata/models/project_role.rb +4 -0
  184. data/lib/gooddata/models/report_data_result.rb +217 -125
  185. data/lib/gooddata/models/schedule.rb +140 -65
  186. data/lib/gooddata/models/tab_builder.rb +4 -0
  187. data/lib/gooddata/models/user_filters/mandatory_user_filter.rb +4 -0
  188. data/lib/gooddata/models/user_filters/user_filter.rb +4 -0
  189. data/lib/gooddata/models/user_filters/user_filter_builder.rb +98 -56
  190. data/lib/gooddata/models/user_filters/user_filters.rb +4 -0
  191. data/lib/gooddata/models/user_filters/variable_user_filter.rb +4 -0
  192. data/lib/gooddata/rest/client.rb +41 -38
  193. data/lib/gooddata/rest/connection.rb +91 -20
  194. data/lib/gooddata/rest/connections/rest_client_connection.rb +5 -1
  195. data/lib/gooddata/rest/object.rb +9 -1
  196. data/lib/gooddata/rest/object_factory.rb +5 -1
  197. data/lib/gooddata/rest/resource.rb +5 -1
  198. data/lib/gooddata/rest/rest.rb +4 -0
  199. data/lib/gooddata/version.rb +5 -1
  200. data/spec/bricks/bricks_spec.rb +4 -0
  201. data/spec/data/blueprints/test_project_model_spec.json +2 -2
  202. data/spec/data/gooddata_version_process/gooddata_version.rb +6 -0
  203. data/spec/data/hello_world_process/hello_world.rb +6 -0
  204. data/spec/data/manifests/test_project.json +5 -5
  205. data/spec/data/reports/left_attr_report.json +108 -0
  206. data/spec/data/reports/metric_only_one_line.json +83 -0
  207. data/spec/data/reports/report_1.json +197 -0
  208. data/spec/data/reports/top_attr_report.json +108 -0
  209. data/spec/data/ruby_params_process/ruby_params.rb +6 -0
  210. data/spec/data/ruby_process/process.rb +6 -0
  211. data/spec/environment/default.rb +5 -0
  212. data/spec/environment/develop.rb +10 -5
  213. data/spec/environment/environment.rb +4 -0
  214. data/spec/environment/hotfix.rb +5 -1
  215. data/spec/environment/production.rb +4 -0
  216. data/spec/environment/release.rb +4 -0
  217. data/spec/environment/staging.rb +30 -0
  218. data/spec/environment/staging_3.rb +37 -0
  219. data/spec/helpers/blueprint_helper.rb +4 -0
  220. data/spec/helpers/cli_helper.rb +4 -0
  221. data/spec/helpers/connection_helper.rb +24 -17
  222. data/spec/helpers/crypto_helper.rb +6 -0
  223. data/spec/helpers/csv_helper.rb +4 -0
  224. data/spec/helpers/process_helper.rb +5 -1
  225. data/spec/helpers/project_helper.rb +34 -29
  226. data/spec/helpers/schedule_helper.rb +4 -0
  227. data/spec/helpers/spec_helper.rb +4 -0
  228. data/spec/integration/blueprint_updates_spec.rb +28 -20
  229. data/spec/integration/command_datawarehouse_spec.rb +6 -0
  230. data/spec/integration/command_projects_spec.rb +6 -4
  231. data/spec/integration/create_from_template_spec.rb +6 -0
  232. data/spec/integration/create_project_spec.rb +6 -0
  233. data/spec/integration/deprecated_load_spec.rb +58 -0
  234. data/spec/integration/full_process_schedule_spec.rb +9 -0
  235. data/spec/integration/full_project_spec.rb +63 -9
  236. data/spec/integration/over_to_user_filters_spec.rb +7 -2
  237. data/spec/integration/partial_md_export_import_spec.rb +6 -0
  238. data/spec/integration/project_spec.rb +12 -6
  239. data/spec/integration/rest_spec.rb +6 -2
  240. data/spec/integration/schedule_spec.rb +627 -0
  241. data/spec/integration/user_filters_spec.rb +122 -21
  242. data/spec/integration/variables_spec.rb +8 -15
  243. data/spec/logging_in_logging_out_spec.rb +58 -0
  244. data/spec/spec_helper.rb +10 -5
  245. data/spec/unit/bricks/bricks_spec.rb +4 -0
  246. data/spec/unit/bricks/middleware/aws_middelware_spec.rb +4 -0
  247. data/spec/unit/bricks/middleware/bench_middleware_spec.rb +4 -0
  248. data/spec/unit/bricks/middleware/bulk_salesforce_middleware_spec.rb +4 -0
  249. data/spec/unit/bricks/middleware/gooddata_middleware_spec.rb +4 -0
  250. data/spec/unit/bricks/middleware/logger_middleware_spec.rb +4 -0
  251. data/spec/unit/bricks/middleware/restforce_middleware_spec.rb +4 -0
  252. data/spec/unit/bricks/middleware/stdout_middleware_spec.rb +4 -0
  253. data/spec/unit/bricks/middleware/twitter_middleware_spec.rb +4 -0
  254. data/spec/unit/cli/cli_spec.rb +4 -0
  255. data/spec/unit/cli/commands/cmd_api_spec.rb +4 -0
  256. data/spec/unit/cli/commands/cmd_auth_spec.rb +4 -0
  257. data/spec/unit/cli/commands/cmd_domain_spec.rb +4 -0
  258. data/spec/unit/cli/commands/cmd_process_spec.rb +4 -0
  259. data/spec/unit/cli/commands/cmd_project_spec.rb +4 -0
  260. data/spec/unit/cli/commands/cmd_role_spec.rb +4 -0
  261. data/spec/unit/cli/commands/cmd_run_ruby_spec.rb +4 -0
  262. data/spec/unit/cli/commands/cmd_scaffold_spec.rb +6 -0
  263. data/spec/unit/cli/commands/cmd_user_spec.rb +6 -0
  264. data/spec/unit/commands/command_api_spec.rb +6 -0
  265. data/spec/unit/commands/command_auth_spec.rb +6 -0
  266. data/spec/unit/commands/command_dataset_spec.rb +10 -4
  267. data/spec/unit/commands/command_process_spec.rb +6 -0
  268. data/spec/unit/commands/command_projects_spec.rb +6 -0
  269. data/spec/unit/commands/command_scaffold_spec.rb +6 -0
  270. data/spec/unit/commands/command_user_spec.rb +6 -0
  271. data/spec/unit/core/connection_spec.rb +6 -0
  272. data/spec/unit/core/logging_spec.rb +4 -0
  273. data/spec/unit/core/nil_logger_spec.rb +4 -0
  274. data/spec/unit/core/project_spec.rb +4 -0
  275. data/spec/unit/data/guesser_spec.rb +6 -2
  276. data/spec/unit/extensions/hash_spec.rb +4 -0
  277. data/spec/unit/godzilla/goodzilla_spec.rb +4 -0
  278. data/spec/unit/helpers/csv_helper_spec.rb +4 -0
  279. data/spec/unit/helpers/data_helper_spec.rb +4 -0
  280. data/spec/unit/helpers/global_helpers_spec.rb +54 -0
  281. data/spec/unit/helpers_spec.rb +6 -1
  282. data/spec/unit/models/blueprint/attributes_spec.rb +5 -0
  283. data/spec/unit/models/blueprint/dataset_spec.rb +5 -0
  284. data/spec/unit/models/blueprint/labels_spec.rb +5 -0
  285. data/spec/unit/models/blueprint/project_blueprint_spec.rb +5 -0
  286. data/spec/unit/models/blueprint/reference_spec.rb +5 -0
  287. data/spec/unit/models/blueprint/schema_builder_spec.rb +4 -0
  288. data/spec/unit/models/blueprint/to_wire_spec.rb +5 -0
  289. data/spec/unit/models/domain_spec.rb +9 -7
  290. data/spec/unit/models/execution_spec.rb +6 -0
  291. data/spec/unit/models/from_wire_spec.rb +4 -0
  292. data/spec/unit/models/invitation_spec.rb +4 -0
  293. data/spec/unit/models/membership_spec.rb +4 -0
  294. data/spec/unit/models/metadata_spec.rb +46 -0
  295. data/spec/unit/models/metric_spec.rb +4 -0
  296. data/spec/unit/models/model_spec.rb +4 -0
  297. data/spec/unit/models/params_spec.rb +4 -0
  298. data/spec/unit/models/profile_spec.rb +4 -0
  299. data/spec/unit/models/project_creator_spec.rb +127 -0
  300. data/spec/unit/models/project_role_spec.rb +4 -0
  301. data/spec/unit/models/project_spec.rb +4 -0
  302. data/spec/unit/models/report_result_data_spec.rb +193 -0
  303. data/spec/unit/models/schedule_spec.rb +241 -386
  304. data/spec/unit/models/to_manifest_spec.rb +21 -0
  305. data/spec/unit/models/{unit_project.rb → unit_project_spec.rb} +21 -18
  306. data/spec/unit/models/user_filters_spec.rb +7 -1
  307. data/spec/unit/models/variable_spec.rb +6 -0
  308. data/spec/unit/rest/polling_spec.rb +8 -5
  309. data/spec/unit/rest/resource_spec.rb +4 -0
  310. metadata +190 -129
  311. data/.autotest +0 -2
  312. data/.travis.yml +0 -22
  313. data/examples.rb +0 -69
  314. data/lib/gooddata/models/data_result.rb +0 -38
  315. data/lib/gooddata/models/empty_result.rb +0 -57
  316. data/spec/unit/models/project_creator.rb +0 -73
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  (BSD License)
2
2
 
3
- Copyright (c) 2010 Thomas Watson Steen & GoodData Corporation. All rights reserved.
3
+ Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
4
4
 
5
5
  Redistribution and use in source and binary forms, with or without modification, are permitted provided
6
6
  that the following conditions are met:
data/LICENSE.rb ADDED
@@ -0,0 +1,5 @@
1
+ # encoding: UTF-8
2
+ #
3
+ # Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
4
+ # This source code is licensed under the BSD-style license found in the
5
+ # LICENSE file in the root directory of this source tree.
data/Rakefile CHANGED
@@ -3,44 +3,40 @@
3
3
  require 'rubygems'
4
4
 
5
5
  require 'bundler/setup'
6
+ require 'bundler/cli'
6
7
  require 'bundler/gem_tasks'
7
8
 
8
- # require 'coveralls/rake/task'
9
-
10
9
  require 'rake/testtask'
11
10
  require 'rake/notes/rake_task'
12
11
  require 'rspec/core/rake_task'
13
12
 
14
13
  require 'yard'
15
14
 
16
- desc "Run Rubocop"
15
+ desc 'Run Rubocop'
17
16
  task :cop do
18
- exec "rubocop lib/"
17
+ exec 'rubocop lib/ gooddata.gemspec Rakefile'
19
18
  end
20
19
 
21
- # Coveralls::RakeTask.new
22
-
23
20
  desc 'Run continuous integration test'
24
21
  task :ci do
25
22
  Rake::Task['test:unit'].invoke
26
23
  unless ENV['TRAVIS'] == 'true' && ENV['TRAVIS_SECURE_ENV_VARS'] == 'false'
27
24
  Rake::Task['test:integration'].invoke
28
25
  end
29
- Rake::Task['test:cop'].invoke if RUBY_VERSION.start_with?('2.2') == false
30
- # Rake::Task['coveralls:push'].invoke
26
+ Rake::Task['test:cop'].invoke
31
27
  end
32
28
 
33
29
  namespace :gem do
34
30
  desc "Release gem version #{GoodData::VERSION} to rubygems"
35
- task :release do |t|
31
+ task :release do
36
32
  gem = "gooddata-#{GoodData::VERSION}.gem"
37
33
 
38
34
  puts "Building #{gem} ..."
39
35
  res = system('gem build ./gooddata.gemspec')
40
- next if !res
36
+ next unless res
41
37
 
42
38
  puts "Pushing #{gem} ..."
43
- res = system("gem push #{gem}")
39
+ system("gem push #{gem}")
44
40
  end
45
41
  end
46
42
 
@@ -48,8 +44,8 @@ namespace :hook do
48
44
  hook_path = File.join(File.dirname(__FILE__), '.git', 'hooks', 'pre-commit').to_s
49
45
 
50
46
  desc 'Installs git pre-commit hook running rubocop'
51
- task :install do |t|
52
- if(File.exist?(hook_path))
47
+ task :install do
48
+ if File.exist?(hook_path)
53
49
  puts 'Git pre-commit hook is already installed'
54
50
  else
55
51
  File.open(hook_path, 'w') do |file|
@@ -63,7 +59,7 @@ namespace :hook do
63
59
  end
64
60
 
65
61
  desc 'Uninstalls git pre-commit hook'
66
- task :uninstall do |t|
62
+ task :uninstall do
67
63
  res = File.exist?(hook_path)
68
64
  if res
69
65
  puts 'Uninstalling git pre-commit hook'
@@ -83,41 +79,97 @@ namespace :hook do
83
79
  puts 'Git pre-commit IS NOT installed'
84
80
  end
85
81
  end
86
-
87
82
  end
88
83
 
84
+ namespace :license do
85
+ desc 'Show license report'
86
+ task :info do
87
+ Bundler::CLI.start(['exec', 'license_finder', '--decisions-file', 'dependency_decisions.yml'])
88
+ end
89
+
90
+ desc 'Generate licenses report - DEPENDENCIES.md'
91
+ task :report do
92
+ `bundle exec license_finder report --decisions-file dependency_decisions.yml --format=markdown > DEPENDENCIES.md`
93
+ end
94
+
95
+ desc 'Check if DEPENDENCIES.md is up to date'
96
+ task :check do
97
+ Rake::Task['license:report'].invoke
98
+ res = `git diff --stat DEPENDENCIES.md`
99
+ fail 'License check error' unless res.include?('1 file changed, 1 insertion(+), 1 deletion(-)')
100
+
101
+ puts 'All licenses seem to be OK'
102
+ end
103
+
104
+ desc 'Add license header to each file'
105
+ task :add do
106
+ spec = Gem::Specification.load('gooddata.gemspec')
107
+ license = File.readlines(File.expand_path('../LICENSE.rb', __FILE__))
108
+ license << "\n"
109
+ license_lines = license.length
110
+
111
+ spec.files.each do |path|
112
+ next if path == 'LICENSE.rb'
113
+ next unless path.end_with?('.rb')
114
+
115
+ puts "Processing #{path}"
116
+
117
+ content = File.read(path)
118
+ content_lines = content.lines
119
+
120
+ update = content_lines.length < license_lines
121
+
122
+ if update == false
123
+ content_with_license = (license + content_lines[license_lines..-1]).join
124
+ update = content != content_with_license
125
+ end
126
+
127
+ next unless update
128
+
129
+ puts "Updating #{path}"
130
+
131
+ if content_lines.length > 0 && content_lines[0].downcase.strip == '# encoding: utf-8'
132
+ content_lines.slice!(0)
133
+ content_lines.slice!(0) if content_lines[0] == "\n"
134
+ end
135
+
136
+ new_content = (license + content_lines).join
137
+ File.open(path, 'w') { |file| file.write(new_content) }
138
+ end
139
+ end
140
+ end
89
141
 
90
142
  RSpec::Core::RakeTask.new(:test)
91
143
 
92
144
  namespace :test do
93
- desc "Run unit tests"
145
+ desc 'Run unit tests'
94
146
  RSpec::Core::RakeTask.new(:unit) do |t|
95
147
  t.pattern = 'spec/unit/**/*.rb'
96
148
  end
97
149
 
98
- desc "Run integration tests"
150
+ desc 'Run integration tests'
99
151
  RSpec::Core::RakeTask.new(:integration) do |t|
100
152
  t.pattern = 'spec/integration/**/*.rb'
101
153
  end
102
154
 
103
- desc "Run legacy tests"
155
+ desc 'Run legacy tests'
104
156
  RSpec::Core::RakeTask.new(:legacy) do |t|
105
157
  t.pattern = 'test/**/test_*.rb'
106
158
  end
107
159
 
108
- desc "Run coding style tests"
109
- RSpec::Core::RakeTask.new(:cop) do |t|
160
+ desc 'Run coding style tests'
161
+ RSpec::Core::RakeTask.new(:cop) do
110
162
  Rake::Task['cop'].invoke
111
163
  end
112
164
 
113
165
  task :all => [:unit, :integration, :cop]
114
166
  end
115
167
 
116
- desc "Run all tests"
168
+ desc 'Run all tests'
117
169
  task :test => 'test:all'
118
170
 
119
171
  task :usage do
120
- puts "No rake task specified, use rake -T to list them"
172
+ puts 'No rake task specified, use rake -T to list them'
121
173
  end
122
174
 
123
175
  YARD::Rake::YardocTask.new
@@ -0,0 +1,102 @@
1
+ ---
2
+ - - :whitelist
3
+ - MIT
4
+ - :who:
5
+ :why:
6
+ :when: 2015-07-17 19:58:05.941481000 Z
7
+ - - :add_package
8
+ - rake
9
+ -
10
+ - &1
11
+ :who:
12
+ :why:
13
+ :when: 2015-07-17 20:06:59.009509000 Z
14
+ - - :license
15
+ - rake
16
+ - MIT
17
+ - *1
18
+ - - :add_package
19
+ - colored
20
+ -
21
+ - &2
22
+ :who:
23
+ :why:
24
+ :when: 2015-07-17 20:07:00.038919000 Z
25
+ - - :license
26
+ - colored
27
+ - MIT
28
+ - *2
29
+ - - :add_package
30
+ - pmap
31
+ -
32
+ - &3
33
+ :who:
34
+ :why:
35
+ :when: 2015-07-17 20:07:01.179721000 Z
36
+ - - :license
37
+ - pmap
38
+ - Apache 2.0
39
+ - *3
40
+ - - :add_package
41
+ - mime-types
42
+ -
43
+ - &4
44
+ :who:
45
+ :why:
46
+ :when: 2015-07-17 20:07:02.216723000 Z
47
+ - - :license
48
+ - mime-types
49
+ - MIT
50
+ - *4
51
+ - - :add_package
52
+ - diff-lcs
53
+ -
54
+ - &5
55
+ :who:
56
+ :why:
57
+ :when: 2015-07-17 20:07:03.248925000 Z
58
+ - - :license
59
+ - diff-lcs
60
+ - MIT
61
+ - *5
62
+ - - :add_package
63
+ - rubyzip
64
+ -
65
+ - &6
66
+ :who:
67
+ :why:
68
+ :when: 2015-07-17 20:07:04.296985000 Z
69
+ - - :license
70
+ - rubyzip
71
+ - ruby
72
+ - *6
73
+ - - :whitelist
74
+ - MIT
75
+ - :who:
76
+ :why:
77
+ :when: 2015-07-17 20:07:05.347602000 Z
78
+ - - :whitelist
79
+ - Apache 2.0
80
+ - :who:
81
+ :why:
82
+ :when: 2015-07-17 20:07:06.371393000 Z
83
+ - - :whitelist
84
+ - ruby
85
+ - :who:
86
+ :why:
87
+ :when: 2015-07-17 20:07:07.417378000 Z
88
+ - - :whitelist
89
+ - BSD
90
+ - :who:
91
+ :why:
92
+ :when: 2015-07-17 20:07:08.448183000 Z
93
+ - - :whitelist
94
+ - GPL-2
95
+ - :who:
96
+ :why:
97
+ :when: 2015-07-17 20:07:12.266179000 Z
98
+ - - :approve
99
+ - bundler
100
+ - :who:
101
+ :why:
102
+ :when: 2015-08-03 10:50:05.464030000 Z
data/gooddata.gemspec CHANGED
@@ -1,63 +1,64 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib/", __FILE__)
1
+ # encoding: utf-8
2
+ $LOAD_PATH.push File.expand_path('../lib/', __FILE__)
3
3
  require 'gooddata/version'
4
4
 
5
5
  Gem::Specification.new do |s|
6
- s.name = %q{gooddata}
6
+ s.name = 'gooddata'
7
7
  s.version = GoodData::VERSION
8
8
  s.licenses = ['BSD']
9
9
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
10
+ s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [
12
- 'Pavel Kolesnikov',
13
- 'Thomas Watson Steen',
14
- 'Tomas Svarovsky',
15
- 'Tomas Korcak'
12
+ 'Pavel Kolesnikov',
13
+ 'Thomas Watson Steen',
14
+ 'Tomas Svarovsky',
15
+ 'Tomas Korcak'
16
16
  ]
17
17
 
18
- s.summary = %q{A convenient Ruby wrapper around the GoodData RESTful API}
19
- s.description = %q{Use the GoodData::Client class to integrate GoodData into your own application or use the CLI to work with GoodData directly from the command line.}
20
- s.email = %q{pavel@gooddata.com}
18
+ s.summary = 'A convenient Ruby wrapper around the GoodData RESTful API'
19
+ s.description = 'Use the GoodData::Client class to integrate GoodData into your own application or use the CLI to work with GoodData directly from the command line.'
20
+ s.email = 'pavel@gooddata.com'
21
21
  s.extra_rdoc_files = %w(LICENSE README.md)
22
22
 
23
- s.files = `git ls-files`.split($/)
23
+ s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
24
24
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
25
25
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
26
26
 
27
- s.homepage = %q{http://github.com/gooddata/gooddata-ruby}
28
- s.require_paths = ["lib"]
27
+ s.homepage = 'http://github.com/gooddata/gooddata-ruby'
28
+ s.require_paths = ['lib']
29
29
 
30
- s.add_development_dependency 'rake', '~> 10.3', '>= 10.3.1'
30
+ s.add_development_dependency 'bundler', '~> 1.10.6', '>= 1.10.6'
31
+ s.add_development_dependency 'coveralls', '~> 0.8', '>= 0.8.2'
32
+ s.add_development_dependency 'debase', '~> 0.1', '>= 0.1.7' if !ENV['TRAVIS_BUILD'] && RUBY_VERSION >= '2.0.0'
33
+ s.add_development_dependency 'guard', '~> 2.13', '>= 2.13.0'
34
+ s.add_development_dependency 'guard-rspec', '~> 4.6', '>= 4.6.4'
35
+ s.add_development_dependency 'license_finder', '~> 2.0', '>= 2.0.4'
36
+ s.add_development_dependency 'rake', '~> 10.4', '>= 10.4.2'
31
37
  s.add_development_dependency 'rake-notes', '~> 0.2', '>= 0.2.0'
32
38
  s.add_development_dependency 'redcarpet', '~> 3.1', '>= 3.1.1' if RUBY_PLATFORM != 'java'
33
- s.add_development_dependency 'rspec', '~> 2.14', '>= 2.14.1'
34
- s.add_development_dependency 'rubocop', '~> 0.32.1', '>= 0.32.1'
35
- s.add_development_dependency 'simplecov', '~> 0.9', '>= 0.9.1'
36
- s.add_development_dependency 'yard', '~> 0.8.7.3'
39
+ s.add_development_dependency 'rspec', '~> 3.3', '>= 3.3.0'
40
+ s.add_development_dependency 'rubocop', '~> 0.34', '>= 0.34.0'
41
+ s.add_development_dependency 'ruby-debug-ide', '~> 0.4' if !ENV['TRAVIS_BUILD'] && RUBY_VERSION >= '2.0.0'
42
+ s.add_development_dependency 'simplecov', '~> 0.10', '>= 0.10.0'
43
+ s.add_development_dependency 'webmock', '~> 1.21', '>= 1.21.0'
44
+ s.add_development_dependency 'yard', '~> 0.8.7.6'
37
45
  s.add_development_dependency 'yard-rspec', '~> 0.1'
38
46
  s.add_development_dependency 'ZenTest', '~> 4.10', '>= 4.11.0'
39
- s.add_development_dependency 'coveralls', '~> 0.7', '>= 0.7.0'
40
- s.add_development_dependency 'guard', '~> 2'
41
- s.add_development_dependency 'guard-rspec', '~> 4'
42
- s.add_development_dependency 'webmock', '~> 1.21', '>= 1.21.0'
43
- s.add_development_dependency 'debase', '~> 0.1', '>= 0.1.7' if !ENV['TRAVIS_BUILD'] && RUBY_VERSION >= '2.0.0'
44
- s.add_development_dependency 'ruby-debug-ide', '~> 0.4' if !ENV['TRAVIS_BUILD'] && RUBY_VERSION >= '2.0.0'
45
- s.add_development_dependency 'bundler', '~> 1.7', '>= 1.7.3'
46
47
 
48
+ s.add_dependency 'aws-sdk', '~> 1.45'
47
49
  s.add_dependency 'docile', '~> 1.1', '>= 1.1.5'
48
50
  s.add_dependency 'erubis', '~> 2.7', '>= 2.7.0'
49
- s.add_dependency 'gli', '~> 2.12', '>= 2.12.2'
50
- s.add_dependency 'highline', '~> 1.6', '>= 1.6.21'
51
- s.add_dependency 'json_pure', '~> 1.8', '>= 1.8.1'
52
- s.add_dependency 'multi_json', '~> 1.10', '>= 1.10.0'
53
- s.add_dependency 'parseconfig', '~> 1.0', '>= 1.0.4'
54
- s.add_dependency 'pmap', '~> 1.0', '>= 1.0.1'
51
+ s.add_dependency 'gli', '~> 2.13', '>= 2.13.2'
52
+ s.add_dependency 'highline', '~> 1.7', '>= 1.7.3'
53
+ s.add_dependency 'json_pure', '~> 1.8', '>= 1.8.2'
54
+ s.add_dependency 'multi_json', '~> 1.11', '>= 1.11.2'
55
+ s.add_dependency 'parseconfig', '~> 1.0', '>= 1.0.6'
56
+ s.add_dependency 'pmap', '~> 1.0', '>= 1.0.2'
55
57
  s.add_dependency 'pry', '~> 0.9.12.6' # '~> 0.10', '>= 0.10.1'
56
- s.add_dependency 'restforce', '~> 1.5', '>= 1.5.0'
57
- s.add_dependency 'rest-client', '~> 1.7.2', '>= 1.7.2'
58
- s.add_dependency 'rubyzip', '~> 1.1', '>= 1.1.0'
59
- s.add_dependency 'terminal-table', '~> 1.5', '>= 1.5.1'
60
- s.add_dependency 'salesforce_bulk_query', '~> 0.0'
61
- s.add_dependency 'aws-sdk', '~> 1.45'
58
+ s.add_dependency 'restforce', '~> 2.1', '>= 2.1.1'
59
+ s.add_dependency 'rest-client', '~> 1.8', '>= 1.8.0'
60
+ s.add_dependency 'rubyzip', '~> 1.1', '>= 1.1.7'
61
+ s.add_dependency 'salesforce_bulk_query', '~> 0.2', '>= 0.2.0'
62
+ s.add_dependency 'terminal-table', '~> 1.5', '>= 1.5.2'
62
63
  s.add_dependency 'thread_safe'
63
64
  end
data/lib/gooddata.rb CHANGED
@@ -1,4 +1,8 @@
1
1
  # encoding: UTF-8
2
+ #
3
+ # Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
4
+ # This source code is licensed under the BSD-style license found in the
5
+ # LICENSE file in the root directory of this source tree.
2
6
 
3
7
  require 'pmap'
4
8
  $pmap_default_thread_count = 20 # rubocop:disable GlobalVars
@@ -1,4 +1,8 @@
1
1
  # encoding: UTF-8
2
+ #
3
+ # Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
4
+ # This source code is licensed under the BSD-style license found in the
5
+ # LICENSE file in the root directory of this source tree.
2
6
 
3
7
  require_relative '../rest/rest'
4
8
 
@@ -1,4 +1,8 @@
1
1
  # encoding: UTF-8
2
+ #
3
+ # Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
4
+ # This source code is licensed under the BSD-style license found in the
5
+ # LICENSE file in the root directory of this source tree.
2
6
 
3
7
  require 'pathname'
4
8
  require 'aws'
@@ -38,7 +42,7 @@ module GoodData
38
42
  bucket = s3.buckets.create(bucket_name) unless bucket.exists?
39
43
 
40
44
  files.each do |file|
41
- file_path = Pathname.new(file)
45
+ file_path = Pathname.new(file)
42
46
  target_path = Pathname.new(@params['s3_backup_path'] || '') + file_path.basename
43
47
  obj = bucket.objects[target_path]
44
48
  obj.write(file_path)
@@ -1,4 +1,8 @@
1
1
  # encoding: UTF-8
2
+ #
3
+ # Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
4
+ # This source code is licensed under the BSD-style license found in the
5
+ # LICENSE file in the root directory of this source tree.
2
6
 
3
7
  require_relative 'base_downloader'
4
8
  require_relative 'utils'
@@ -1,4 +1,9 @@
1
1
  # encoding: UTF-8
2
+ #
3
+ # Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
4
+ # This source code is licensed under the BSD-style license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
2
7
  require 'pathname'
3
8
 
4
9
  base = Pathname(__FILE__).dirname.expand_path