chartmogul-ruby 1.1.5 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +10 -10
  3. data/.rspec +2 -2
  4. data/.travis.yml +9 -4
  5. data/Gemfile +4 -4
  6. data/LICENSE.txt +21 -21
  7. data/README.md +111 -111
  8. data/Rakefile +6 -6
  9. data/bin/console +14 -14
  10. data/bin/setup +9 -9
  11. data/changelog.md +27 -27
  12. data/chartmogul-ruby.gemspec +30 -30
  13. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/adds_custom_attributes.yml +80 -80
  14. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/adds_required_tags.yml +79 -79
  15. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/can_page_through_search_endpoint.yml +43 -43
  16. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/correctly_handles_a_422_response.yml +50 -50
  17. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/correctly_interracts_with_the_API.yml +244 -244
  18. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/merges_customers.yml +185 -185
  19. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/raises_401_if_invalid_credentials.yml +38 -38
  20. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/raises_404_if_no_customers_found.yml +38 -38
  21. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/raises_422_for_update_with_invalid_data.yml +86 -86
  22. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/removes_custom_attributes.yml +80 -80
  23. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/removes_tags.yml +80 -80
  24. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/returns_all_customers_through_list_all_endpoint.yml +47 -47
  25. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/returns_customer_through_retrieve_endpoint.yml +42 -42
  26. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/returns_right_customers_through_search_endpoint.yml +43 -43
  27. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_custom_attributes.yml +82 -82
  28. data/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_customer.yml +139 -139
  29. data/fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/when_external_id_is_provided/returns_matching_user_if_exists.yml +102 -102
  30. data/fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/when_external_id_is_provided/returns_nil_if_customer_does_not_exist.yml +101 -101
  31. data/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Interactions/correctly_interracts_with_the_API.yml +298 -298
  32. data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_interracts_with_the_API.yml +189 -189
  33. data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_404.yml +46 -46
  34. data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_422.yml +48 -48
  35. data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/retrieves_existing_data_source_matching_uuid.yml +101 -101
  36. data/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/deletes_an_invoice.yml +37 -37
  37. data/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/deletes_an_invoice_with_class_method.yml +37 -37
  38. data/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/raises_error_on_deleting_non-existing_invoice.yml +42 -42
  39. data/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/retrieves_existing_invoice_by_uuid.yml +50 -50
  40. data/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/returns_all_invoices_through_list_all_endpoint.yml +46 -46
  41. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +42 -42
  42. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/should_have_entries.yml +42 -42
  43. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +42 -42
  44. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/should_have_entries.yml +42 -42
  45. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -40
  46. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -40
  47. data/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/behaves_like_Pageable/should_be_pageable.yml +41 -41
  48. data/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/should_have_Activity_entries.yml +41 -41
  49. data/fixtures/vcr_cassettes/ChartMogul_Metrics_AllKeyMetric/should_have_entries.yml +42 -42
  50. data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -40
  51. data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -40
  52. data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +42 -42
  53. data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/should_have_entries.yml +42 -42
  54. data/fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -40
  55. data/fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -40
  56. data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/behaves_like_Summary/should_have_summary.yml +42 -42
  57. data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/should_have_entries.yml +42 -42
  58. data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -40
  59. data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -40
  60. data/fixtures/vcr_cassettes/ChartMogul_Metrics_Subscription/behaves_like_Pageable/should_be_pageable.yml +40 -40
  61. data/fixtures/vcr_cassettes/ChartMogul_Metrics_Subscription/should_have_Subscription_entries.yml +40 -40
  62. data/fixtures/vcr_cassettes/ChartMogul_Ping/pings/and_fails_on_incorrect_credentials.yml +38 -38
  63. data/fixtures/vcr_cassettes/ChartMogul_Ping/pings/when_credentials_correct.yml +38 -38
  64. data/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/correctly_handles_a_422_error.yml +51 -51
  65. data/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/correctly_interacts_with_the_API.yml +152 -152
  66. data/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/deletes_existing_plan.yml +198 -198
  67. data/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/retrieves_existing_plan_by_uuid.yml +151 -151
  68. data/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/updates_existing_plan.yml +198 -198
  69. data/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/correctly_interracts_with_the_API.yml +340 -340
  70. data/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/has_multiple_aliases.yml +101 -101
  71. data/fixtures/vcr_cassettes/ChartMogul_Transactions_Payment/API_Interactions/correctly_interracts_with_the_API.yml +243 -243
  72. data/lib/chartmogul.rb +81 -81
  73. data/lib/chartmogul/api/actions/all.rb +23 -23
  74. data/lib/chartmogul/api/actions/create.rb +39 -39
  75. data/lib/chartmogul/api/actions/custom.rb +37 -37
  76. data/lib/chartmogul/api/actions/destroy.rb +27 -27
  77. data/lib/chartmogul/api/actions/retrieve.rb +23 -23
  78. data/lib/chartmogul/api/actions/update.rb +19 -19
  79. data/lib/chartmogul/api_resource.rb +68 -68
  80. data/lib/chartmogul/concerns/entries.rb +37 -37
  81. data/lib/chartmogul/concerns/pageable.rb +13 -13
  82. data/lib/chartmogul/concerns/pageable2.rb +12 -12
  83. data/lib/chartmogul/concerns/summary.rb +19 -19
  84. data/lib/chartmogul/config_attributes.rb +15 -15
  85. data/lib/chartmogul/configuration.rb +6 -6
  86. data/lib/chartmogul/customer.rb +156 -156
  87. data/lib/chartmogul/customer_invoices.rb +44 -44
  88. data/lib/chartmogul/data_source.rb +34 -34
  89. data/lib/chartmogul/enrichment/customer.rb +140 -140
  90. data/lib/chartmogul/errors/chartmogul_error.rb +19 -19
  91. data/lib/chartmogul/errors/configuration_error.rb +4 -4
  92. data/lib/chartmogul/errors/forbidden_error.rb +4 -4
  93. data/lib/chartmogul/errors/not_found_error.rb +4 -4
  94. data/lib/chartmogul/errors/resource_invalid_error.rb +4 -4
  95. data/lib/chartmogul/errors/schema_invalid_error.rb +4 -4
  96. data/lib/chartmogul/errors/unauthorized_error.rb +4 -4
  97. data/lib/chartmogul/invoice.rb +86 -86
  98. data/lib/chartmogul/line_items/one_time.rb +24 -23
  99. data/lib/chartmogul/line_items/subscription.rb +30 -29
  100. data/lib/chartmogul/metrics/activity.rb +33 -33
  101. data/lib/chartmogul/metrics/all_key_metrics.rb +24 -24
  102. data/lib/chartmogul/metrics/arpa.rb +18 -18
  103. data/lib/chartmogul/metrics/arr.rb +18 -18
  104. data/lib/chartmogul/metrics/asp.rb +18 -18
  105. data/lib/chartmogul/metrics/base.rb +54 -54
  106. data/lib/chartmogul/metrics/customer_churn_rate.rb +18 -18
  107. data/lib/chartmogul/metrics/customer_count.rb +18 -18
  108. data/lib/chartmogul/metrics/ltv.rb +18 -18
  109. data/lib/chartmogul/metrics/mrr.rb +26 -26
  110. data/lib/chartmogul/metrics/mrr_churn_rate.rb +18 -18
  111. data/lib/chartmogul/metrics/subscription.rb +37 -37
  112. data/lib/chartmogul/object.rb +119 -119
  113. data/lib/chartmogul/ping.rb +14 -14
  114. data/lib/chartmogul/plan.rb +37 -37
  115. data/lib/chartmogul/resource_path.rb +42 -42
  116. data/lib/chartmogul/subscription.rb +47 -47
  117. data/lib/chartmogul/summary.rb +7 -7
  118. data/lib/chartmogul/transactions/payment.rb +24 -24
  119. data/lib/chartmogul/transactions/refund.rb +24 -24
  120. data/lib/chartmogul/utils/hash_snake_caser.rb +49 -49
  121. data/lib/chartmogul/utils/json_parser.rb +10 -10
  122. data/lib/chartmogul/version.rb +3 -3
  123. metadata +3 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e7ad064432c9e4fecaf637584b5d34052e76055d
4
- data.tar.gz: c54868e20a9715858c983033c6919f585883de3d
2
+ SHA256:
3
+ metadata.gz: f35a27b064a7d00d1065e8e0abf6909996b99b31efbb4a3b0b5e4561f5ae973d
4
+ data.tar.gz: fe810c793bd95dc57452e56c7ad3b6bbfae0bc78a862049cc179f45ae3f6e5f7
5
5
  SHA512:
6
- metadata.gz: 09dd03962421da8a7f03e1d11f9317541f5e616e4d45c5f63b52c549d0c6f715c10696281104ad936ee0c1c3418aa0052ae8343f7923694eaebaef1dd1b3cd7e
7
- data.tar.gz: 9246cc2c80a01bbec3fa24f205351bdb1293d44ccd8c9fb6c2cd270c432d2a2ba109bd951f0284aa509e3be0df6c83dcf57cf8cf3a73f82b2c6d4a8cdb004586
6
+ metadata.gz: 6d0cc07345770baf3280ce4b62a8052682f466387ce8120044172ac19086938631c7958ec59f7a745187b018d520e97944b12c20a2744fc6d1fc61a5acdeb61b
7
+ data.tar.gz: abdcea8b4a2b2cf06de0f4a0ceaa4a7e8d4bcc252258fbb93f2d026bed2f63cd0e7803e6b6b940d412a41c8338a55a39d62d1e66e9a75d6446eb5af896ff949e
data/.gitignore CHANGED
@@ -1,10 +1,10 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- *.swp
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.swp
data/.rspec CHANGED
@@ -1,2 +1,2 @@
1
- --format documentation
2
- --color
1
+ --format documentation
2
+ --color
@@ -1,4 +1,9 @@
1
- language: ruby
2
- rvm:
3
- - 2.3.0
4
- before_install: gem install bundler
1
+ language: ruby
2
+ rvm:
3
+ - 2.3.0
4
+
5
+ before_install: gem install bundler
6
+
7
+ branches:
8
+ only:
9
+ - master
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in chartmogul-ruby.gemspec
4
- gemspec
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in chartmogul-ruby.gemspec
4
+ gemspec
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2016 ChartMogul Ltd
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 ChartMogul Ltd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,111 +1,111 @@
1
- <p align="center">
2
- <a href="https://chartmogul.com"><img width="200" src="https://chartmogul.com/assets/img/logo.png"></a>
3
- </p>
4
-
5
- <h3 align="center">Official ChartMogul API Ruby Client</h3>
6
-
7
- <p align="center"><code>chartmogul-ruby</code> provides convenient Ruby bindings for <a href="https://dev.chartmogul.com">ChartMogul's API</a>.</p>
8
-
9
- <p align="center">
10
- <a href="https://badge.fury.io/rb/chartmogul-ruby"><img src="https://badge.fury.io/rb/chartmogul-ruby.svg" alt="Gem Version"></a>
11
- <a href="https://travis-ci.org/chartmogul/chartmogul-ruby"><img src="https://travis-ci.org/chartmogul/chartmogul-ruby.svg?branch=master" alt="Travis project"></a>
12
- </p>
13
-
14
- <hr>
15
-
16
- <p align="center">
17
- <b><a href="#installation">Installation</a></b>
18
- |
19
- <b><a href="#configuration">Configuration</a></b>
20
- |
21
- <b><a href="#usage">Usage</a></b>
22
- |
23
- <b><a href="#development">Development</a></b>
24
- |
25
- <b><a href="#contributing">Contributing</a></b>
26
- |
27
- <b><a href="#license">License</a></b>
28
- </p>
29
-
30
- <hr>
31
- <br>
32
-
33
-
34
- ## Installation
35
-
36
- Add this line to your application's Gemfile:
37
-
38
- ```ruby
39
- gem 'chartmogul-ruby', require: 'chartmogul'
40
- ```
41
-
42
- And then execute:
43
-
44
- $ bundle
45
-
46
- Or install it yourself as:
47
-
48
- $ gem install chartmogul-ruby
49
-
50
- ## Configuration
51
-
52
- Configure `chartmogul-ruby` with your Account Token and Secret Key, available from the administration section of your ChartMogul account.
53
-
54
- ```ruby
55
- ChartMogul.account_token = '<Account key goes here>'
56
- ChartMogul.secret_key = '<Secret key goes here>'
57
- ```
58
-
59
- Test your authentication:
60
- ```ruby
61
- ChartMogul::Ping.ping
62
- ```
63
-
64
- ## Usage
65
-
66
- For example, to create a Data Source object,
67
-
68
- Request:
69
- ```ruby
70
- ChartMogul::DataSource.create!(
71
- name: 'In-house billing'
72
- )
73
- ```
74
-
75
- Response:
76
- ```ruby
77
- #<ChartMogul::DataSource:0x007ff9f127d628
78
- @name="In-house billing",
79
- @uuid="ds_cfc2b8f2-ad2c-4e3d-b64f-58d0bb282824",
80
- @status="never_imported",
81
- @created_at=2016-06-27 11:27:37 UTC
82
- >
83
- ```
84
-
85
- You can find examples for each endpoint in the ChartMogul [API documentation](https://dev.chartmogul.com/).
86
-
87
- [![https://gyazo.com/f7a2a1b86a409586ee8dd0f4f7563937](https://i.gyazo.com/f7a2a1b86a409586ee8dd0f4f7563937.gif)](https://i.gyazo.com/f7a2a1b86a409586ee8dd0f4f7563937.gif)
88
-
89
- ## Development
90
-
91
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
92
-
93
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
94
-
95
- ## Contributing
96
-
97
- Bug reports and pull requests are welcome on GitHub at https://github.com/chartmogul/chartmogul-ruby.
98
-
99
- ## License
100
-
101
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
102
-
103
- ### The MIT License (MIT)
104
-
105
- *Copyright (c) 2016 ChartMogul Ltd.*
106
-
107
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
108
-
109
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
110
-
111
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ <p align="center">
2
+ <a href="https://chartmogul.com"><img width="200" src="https://chartmogul.com/assets/img/logo.png"></a>
3
+ </p>
4
+
5
+ <h3 align="center">Official ChartMogul API Ruby Client</h3>
6
+
7
+ <p align="center"><code>chartmogul-ruby</code> provides convenient Ruby bindings for <a href="https://dev.chartmogul.com">ChartMogul's API</a>.</p>
8
+
9
+ <p align="center">
10
+ <a href="https://badge.fury.io/rb/chartmogul-ruby"><img src="https://badge.fury.io/rb/chartmogul-ruby.svg" alt="Gem Version"></a>
11
+ <a href="https://travis-ci.org/chartmogul/chartmogul-ruby"><img src="https://travis-ci.org/chartmogul/chartmogul-ruby.svg?branch=master" alt="Travis project"></a>
12
+ </p>
13
+
14
+ <hr>
15
+
16
+ <p align="center">
17
+ <b><a href="#installation">Installation</a></b>
18
+ |
19
+ <b><a href="#configuration">Configuration</a></b>
20
+ |
21
+ <b><a href="#usage">Usage</a></b>
22
+ |
23
+ <b><a href="#development">Development</a></b>
24
+ |
25
+ <b><a href="#contributing">Contributing</a></b>
26
+ |
27
+ <b><a href="#license">License</a></b>
28
+ </p>
29
+
30
+ <hr>
31
+ <br>
32
+
33
+
34
+ ## Installation
35
+
36
+ Add this line to your application's Gemfile:
37
+
38
+ ```ruby
39
+ gem 'chartmogul-ruby', require: 'chartmogul'
40
+ ```
41
+
42
+ And then execute:
43
+
44
+ $ bundle
45
+
46
+ Or install it yourself as:
47
+
48
+ $ gem install chartmogul-ruby
49
+
50
+ ## Configuration
51
+
52
+ Configure `chartmogul-ruby` with your Account Token and Secret Key, available from the administration section of your ChartMogul account.
53
+
54
+ ```ruby
55
+ ChartMogul.account_token = '<Account key goes here>'
56
+ ChartMogul.secret_key = '<Secret key goes here>'
57
+ ```
58
+
59
+ Test your authentication:
60
+ ```ruby
61
+ ChartMogul::Ping.ping
62
+ ```
63
+
64
+ ## Usage
65
+
66
+ For example, to create a Data Source object,
67
+
68
+ Request:
69
+ ```ruby
70
+ ChartMogul::DataSource.create!(
71
+ name: 'In-house billing'
72
+ )
73
+ ```
74
+
75
+ Response:
76
+ ```ruby
77
+ #<ChartMogul::DataSource:0x007ff9f127d628
78
+ @name="In-house billing",
79
+ @uuid="ds_cfc2b8f2-ad2c-4e3d-b64f-58d0bb282824",
80
+ @status="never_imported",
81
+ @created_at=2016-06-27 11:27:37 UTC
82
+ >
83
+ ```
84
+
85
+ You can find examples for each endpoint in the ChartMogul [API documentation](https://dev.chartmogul.com/).
86
+
87
+ [![https://gyazo.com/f7a2a1b86a409586ee8dd0f4f7563937](https://i.gyazo.com/f7a2a1b86a409586ee8dd0f4f7563937.gif)](https://i.gyazo.com/f7a2a1b86a409586ee8dd0f4f7563937.gif)
88
+
89
+ ## Development
90
+
91
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
92
+
93
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
94
+
95
+ ## Contributing
96
+
97
+ Bug reports and pull requests are welcome on GitHub at https://github.com/chartmogul/chartmogul-ruby.
98
+
99
+ ## License
100
+
101
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
102
+
103
+ ### The MIT License (MIT)
104
+
105
+ *Copyright (c) 2016 ChartMogul Ltd.*
106
+
107
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
108
+
109
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
110
+
111
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
- require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task default: :spec
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
@@ -1,14 +1,14 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'bundler/setup'
4
- require 'chartmogul'
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require 'irb'
14
- IRB.start
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'chartmogul'
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require 'irb'
14
+ IRB.start
data/bin/setup CHANGED
@@ -1,9 +1,9 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- gem install bundler
7
- bundle install
8
-
9
- # Do any other automated setup that you need to do here
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ gem install bundler
7
+ bundle install
8
+
9
+ # Do any other automated setup that you need to do here
@@ -1,27 +1,27 @@
1
- # chartmogul-ruby Change Log
2
-
3
- ## Version 1.0.2 - 6 March 2017
4
- - Consolidated Customer, Enrichment/Customer now deprecated
5
-
6
- ## Version 1.0.1 - 21 February 2017
7
- - Fixed all() in Customer, now returns Customers with paging
8
-
9
- ## Version 1.0.0 - 14 February 2017
10
- - Add support for new plan and data source endpoints
11
- - Remove deprecated Import namespace
12
-
13
- ## Version 0.1.4 - 10 November 2016
14
- - Add support for merging customers
15
- - Add support for updating customers
16
-
17
- ## Version 0.1.3 - 8 November 2016
18
- - Add support for lead_created_at and free_trial_started_at fields to work with Leads and Trials charts
19
-
20
- ## Version 0.1.2 - 13 July 2016
21
- - Fix bug preventing cancellation of subscriptions [#22]
22
-
23
- ## Version 0.1.1 - 4 July 2016
24
- - Version bump after 0.1.0 pushed to RubyGems under incorrect account.
25
-
26
- ## Version 0.1.0 - 4 July 2016
27
- - Initial release with support for our Import, Enrichment and Metrics APIs.
1
+ # chartmogul-ruby Change Log
2
+
3
+ ## Version 1.0.2 - 6 March 2017
4
+ - Consolidated Customer, Enrichment/Customer now deprecated
5
+
6
+ ## Version 1.0.1 - 21 February 2017
7
+ - Fixed all() in Customer, now returns Customers with paging
8
+
9
+ ## Version 1.0.0 - 14 February 2017
10
+ - Add support for new plan and data source endpoints
11
+ - Remove deprecated Import namespace
12
+
13
+ ## Version 0.1.4 - 10 November 2016
14
+ - Add support for merging customers
15
+ - Add support for updating customers
16
+
17
+ ## Version 0.1.3 - 8 November 2016
18
+ - Add support for lead_created_at and free_trial_started_at fields to work with Leads and Trials charts
19
+
20
+ ## Version 0.1.2 - 13 July 2016
21
+ - Fix bug preventing cancellation of subscriptions [#22]
22
+
23
+ ## Version 0.1.1 - 4 July 2016
24
+ - Version bump after 0.1.0 pushed to RubyGems under incorrect account.
25
+
26
+ ## Version 0.1.0 - 4 July 2016
27
+ - Initial release with support for our Import, Enrichment and Metrics APIs.