chartmogul-ruby 0.1.1
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.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -0
- data/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +82 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/changelog.md +8 -0
- data/chartmogul-ruby.gemspec +29 -0
- data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_interracts_with_the_API.yml +189 -0
- data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_404.yml +46 -0
- data/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_422.yml +48 -0
- data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/adds_custom_attributes.yml +80 -0
- data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/adds_required_tags.yml +79 -0
- data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/raises_404_if_no_customers_found.yml +38 -0
- data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/removes_custom_attributes.yml +80 -0
- data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/removes_tags.yml +80 -0
- data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/returns_all_customers_through_list_all_endpoint.yml +47 -0
- data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/returns_customer_through_retrieve_endpoint.yml +42 -0
- data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/returns_right_customers_through_search_endpoint.yml +43 -0
- data/fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/updates_custom_attributes.yml +82 -0
- data/fixtures/vcr_cassettes/ChartMogul_Import_Customer/API_Interactions/correctly_handles_a_422_response.yml +50 -0
- data/fixtures/vcr_cassettes/ChartMogul_Import_Customer/API_Interactions/correctly_interracts_with_the_API.yml +240 -0
- data/fixtures/vcr_cassettes/ChartMogul_Import_CustomerInvoices/API_Interactions/correctly_interracts_with_the_API.yml +298 -0
- data/fixtures/vcr_cassettes/ChartMogul_Import_DataSource/API_Interactions/correctly_interracts_with_the_API.yml +189 -0
- data/fixtures/vcr_cassettes/ChartMogul_Import_DataSource/API_Interactions/correctly_raises_errors_on_404.yml +46 -0
- data/fixtures/vcr_cassettes/ChartMogul_Import_DataSource/API_Interactions/correctly_raises_errors_on_422.yml +48 -0
- data/fixtures/vcr_cassettes/ChartMogul_Import_Plan/API_Interractions/correctly_handles_a_422_error.yml +51 -0
- data/fixtures/vcr_cassettes/ChartMogul_Import_Plan/API_Interractions/correctly_interracts_with_the_API.yml +152 -0
- data/fixtures/vcr_cassettes/ChartMogul_Import_Subscription/API_Interactions/correctly_interracts_with_the_API.yml +340 -0
- data/fixtures/vcr_cassettes/ChartMogul_Import_Transactions_Payment/API_Interactions/correctly_interracts_with_the_API.yml +243 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +42 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/should_have_entries.yml +42 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +42 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/should_have_entries.yml +42 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/behaves_like_Pageable/should_be_pageable.yml +41 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/should_have_Activity_entries.yml +41 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_AllKeyMetric/should_have_entries.yml +42 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +42 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/should_have_entries.yml +42 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/behaves_like_Summary/should_have_summary.yml +42 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/should_have_entries.yml +42 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml +40 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml +40 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_Subscription/behaves_like_Pageable/should_be_pageable.yml +40 -0
- data/fixtures/vcr_cassettes/ChartMogul_Metrics_Subscription/should_have_Subscription_entries.yml +40 -0
- data/lib/chartmogul.rb +77 -0
- data/lib/chartmogul/api/actions/all.rb +28 -0
- data/lib/chartmogul/api/actions/create.rb +39 -0
- data/lib/chartmogul/api/actions/custom.rb +42 -0
- data/lib/chartmogul/api/actions/destroy.rb +14 -0
- data/lib/chartmogul/api/actions/update.rb +19 -0
- data/lib/chartmogul/api_resource.rb +57 -0
- data/lib/chartmogul/concerns/entries.rb +37 -0
- data/lib/chartmogul/concerns/pageable.rb +14 -0
- data/lib/chartmogul/concerns/summary.rb +20 -0
- data/lib/chartmogul/config_attributes.rb +15 -0
- data/lib/chartmogul/configuration.rb +6 -0
- data/lib/chartmogul/enrichment/customer.rb +114 -0
- data/lib/chartmogul/errors/chartmogul_error.rb +19 -0
- data/lib/chartmogul/errors/configuration_error.rb +4 -0
- data/lib/chartmogul/errors/forbidden_error.rb +4 -0
- data/lib/chartmogul/errors/not_found_error.rb +4 -0
- data/lib/chartmogul/errors/resource_invalid_error.rb +4 -0
- data/lib/chartmogul/errors/schema_invalid_error.rb +4 -0
- data/lib/chartmogul/import/customer.rb +38 -0
- data/lib/chartmogul/import/customer_invoices.rb +40 -0
- data/lib/chartmogul/import/data_source.rb +19 -0
- data/lib/chartmogul/import/invoice.rb +64 -0
- data/lib/chartmogul/import/line_items/one_time.rb +25 -0
- data/lib/chartmogul/import/line_items/subscription.rb +31 -0
- data/lib/chartmogul/import/plan.rb +21 -0
- data/lib/chartmogul/import/subscription.rb +30 -0
- data/lib/chartmogul/import/transactions/payment.rb +26 -0
- data/lib/chartmogul/import/transactions/refund.rb +26 -0
- data/lib/chartmogul/metrics/activity.rb +32 -0
- data/lib/chartmogul/metrics/all_key_metrics.rb +25 -0
- data/lib/chartmogul/metrics/arpa.rb +19 -0
- data/lib/chartmogul/metrics/arr.rb +19 -0
- data/lib/chartmogul/metrics/asp.rb +19 -0
- data/lib/chartmogul/metrics/base.rb +56 -0
- data/lib/chartmogul/metrics/customer_churn_rate.rb +19 -0
- data/lib/chartmogul/metrics/customer_count.rb +19 -0
- data/lib/chartmogul/metrics/ltv.rb +19 -0
- data/lib/chartmogul/metrics/mrr.rb +26 -0
- data/lib/chartmogul/metrics/mrr_churn_rate.rb +19 -0
- data/lib/chartmogul/metrics/subscription.rb +35 -0
- data/lib/chartmogul/object.rb +119 -0
- data/lib/chartmogul/resource_path.rb +42 -0
- data/lib/chartmogul/summary.rb +7 -0
- data/lib/chartmogul/utils/hash_snake_caser.rb +50 -0
- data/lib/chartmogul/utils/json_parser.rb +11 -0
- data/lib/chartmogul/version.rb +3 -0
- metadata +232 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
require 'set'
|
|
2
|
+
|
|
3
|
+
module ChartMogul
|
|
4
|
+
class Object
|
|
5
|
+
class << self
|
|
6
|
+
def attributes
|
|
7
|
+
@attributes ||= Set.new
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def writeable_attributes
|
|
11
|
+
@writeable_attributes ||= Set.new
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def readonly_attr(attribute, options = {})
|
|
15
|
+
attributes << attribute.to_sym
|
|
16
|
+
define_reader(attribute, options[:default])
|
|
17
|
+
define_private_writer(attribute, options[:type])
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def writeable_attr(attribute, options = {})
|
|
21
|
+
attributes << attribute.to_sym
|
|
22
|
+
writeable_attributes << attribute.to_sym
|
|
23
|
+
|
|
24
|
+
define_reader(attribute, options[:default])
|
|
25
|
+
define_writer(attribute)
|
|
26
|
+
define_private_writer(attribute, options[:type])
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def define_reader(attribute, default)
|
|
30
|
+
define_method(attribute) do
|
|
31
|
+
if instance_variable_defined?("@#{attribute}")
|
|
32
|
+
instance_variable_get("@#{attribute}")
|
|
33
|
+
else
|
|
34
|
+
instance_variable_set("@#{attribute}", default)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def define_private_writer(attribute, type)
|
|
40
|
+
if type == :time
|
|
41
|
+
define_method("set_#{attribute}") do |value|
|
|
42
|
+
instance_variable_set("@#{attribute}", value && Time.parse(value))
|
|
43
|
+
end
|
|
44
|
+
elsif type == :date
|
|
45
|
+
define_method("set_#{attribute}") do |value|
|
|
46
|
+
instance_variable_set("@#{attribute}", value && Date.strptime(value, '%Y-%m-%d'))
|
|
47
|
+
end
|
|
48
|
+
else
|
|
49
|
+
define_method("set_#{attribute}") do |value|
|
|
50
|
+
instance_variable_set("@#{attribute}", value)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
private "set_#{attribute}"
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def define_writer(attribute)
|
|
57
|
+
define_method("#{attribute}=") do |value|
|
|
58
|
+
instance_variable_set("@#{attribute}", value)
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def initialize(attributes = {})
|
|
64
|
+
assign_writeable_attributes(attributes)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def self.new_from_json(attributes={})
|
|
68
|
+
self.new.tap do |resource|
|
|
69
|
+
resource.assign_all_attributes(attributes)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def instance_attributes
|
|
74
|
+
self.class.attributes.each_with_object({}) do |attribute, hash|
|
|
75
|
+
hash[attribute] = send(attribute)
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def assign_writeable_attributes(new_values)
|
|
80
|
+
self.class.writeable_attributes.each do |attr, value|
|
|
81
|
+
self.send("#{attr}=", new_values[attr]) if new_values.key?(attr)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
self
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def assign_all_attributes(new_values)
|
|
88
|
+
self.class.attributes.each do |attr|
|
|
89
|
+
self.send("set_#{attr}", new_values[attr]) if new_values.key?(attr)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
self
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def serialize_for_write
|
|
96
|
+
self.class.writeable_attributes.each_with_object({}) do |attr, attrs|
|
|
97
|
+
serialized_value = serialized_value_for_attr(attr)
|
|
98
|
+
attrs[attr] = serialized_value if allowed_for_write?(serialized_value)
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def allowed_for_write?(serialized_value)
|
|
103
|
+
return false if serialized_value.is_a?(Array) && serialized_value.empty?
|
|
104
|
+
return false if serialized_value.nil?
|
|
105
|
+
|
|
106
|
+
true
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def serialized_value_for_attr(attr)
|
|
110
|
+
serialize_method_name = "serialize_#{attr}"
|
|
111
|
+
|
|
112
|
+
if respond_to?(serialize_method_name)
|
|
113
|
+
send(serialize_method_name)
|
|
114
|
+
else
|
|
115
|
+
send(attr)
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
require 'uri'
|
|
2
|
+
|
|
3
|
+
module ChartMogul
|
|
4
|
+
class ResourcePath
|
|
5
|
+
attr_reader :path
|
|
6
|
+
attr_reader :named_params
|
|
7
|
+
|
|
8
|
+
class RequiredParameterMissing < StandardError; end
|
|
9
|
+
|
|
10
|
+
def initialize(path)
|
|
11
|
+
@path = path
|
|
12
|
+
@named_params = path.scan(/:\w+/).each_with_object({}) do |named_param, hash|
|
|
13
|
+
hash[named_param] = named_param.gsub(':', '').to_sym
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def apply(params = {})
|
|
18
|
+
apply_named_params(params)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# For path = '/hello/:hello_id/say' & params = { hello_id: 1, search: 'cat' }
|
|
22
|
+
# it will return '/hello/1/say?search=cat'
|
|
23
|
+
|
|
24
|
+
def apply_with_get_params(params = {})
|
|
25
|
+
base_path = apply_named_params(params)
|
|
26
|
+
get_params = params.reject { |param_name| named_params.values.include?(param_name) }
|
|
27
|
+
|
|
28
|
+
get_params.empty? ? base_path : "#{base_path}?#{URI.encode_www_form(get_params)}"
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
private
|
|
32
|
+
|
|
33
|
+
def apply_named_params(params)
|
|
34
|
+
path.dup.tap do |path|
|
|
35
|
+
named_params.each do |named_param, param_key|
|
|
36
|
+
raise(RequiredParameterMissing, "#{named_param} is required") unless params.key?(param_key)
|
|
37
|
+
path.gsub!(named_param, params[param_key].to_s)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
module ChartMogul
|
|
2
|
+
module Utils
|
|
3
|
+
class HashSnakeCaser
|
|
4
|
+
#
|
|
5
|
+
# Recursively converts CamelCase and camelBack JSON-style hash keys to
|
|
6
|
+
# Rubyish snake_case, suitable for use during instantiation of Ruby
|
|
7
|
+
# model attributes.
|
|
8
|
+
#
|
|
9
|
+
def initialize(hash)
|
|
10
|
+
@hash = hash
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def to_snake_keys(value = @hash)
|
|
14
|
+
case value
|
|
15
|
+
when Array
|
|
16
|
+
value.map { |v| to_snake_keys(v) }
|
|
17
|
+
when Hash
|
|
18
|
+
snake_hash(value)
|
|
19
|
+
else
|
|
20
|
+
value
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
private
|
|
25
|
+
|
|
26
|
+
def snake_hash(value)
|
|
27
|
+
Hash[value.map { |k, v| [underscore_key(k), to_snake_keys(v)] }]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def underscore_key(k)
|
|
31
|
+
if k.instance_of?(Symbol)
|
|
32
|
+
underscore(k.to_s).to_sym
|
|
33
|
+
elsif k.instance_of?(String)
|
|
34
|
+
underscore(k)
|
|
35
|
+
else
|
|
36
|
+
k # Can't snakify anything except strings and symbols
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def underscore(string)
|
|
41
|
+
string.gsub(/::/, '/')
|
|
42
|
+
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
|
|
43
|
+
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
|
|
44
|
+
.tr('-', '_')
|
|
45
|
+
.downcase
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
metadata
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: chartmogul-ruby
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Jason Langenauer
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2016-07-04 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: faraday
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0.9'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0.9'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: bundler
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '1.11'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '1.11'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rake
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '10.0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '10.0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: rspec
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '3.0'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '3.0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: vcr
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "~>"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '3.0'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - "~>"
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '3.0'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: pry
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - "~>"
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: 0.10.3
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - "~>"
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: 0.10.3
|
|
97
|
+
description: Official Ruby client for ChartMogul's API
|
|
98
|
+
email:
|
|
99
|
+
- jason@chartmogul.com
|
|
100
|
+
executables: []
|
|
101
|
+
extensions: []
|
|
102
|
+
extra_rdoc_files: []
|
|
103
|
+
files:
|
|
104
|
+
- ".gitignore"
|
|
105
|
+
- ".rspec"
|
|
106
|
+
- ".travis.yml"
|
|
107
|
+
- ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml
|
|
108
|
+
- ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml
|
|
109
|
+
- Gemfile
|
|
110
|
+
- LICENSE.txt
|
|
111
|
+
- README.md
|
|
112
|
+
- Rakefile
|
|
113
|
+
- bin/console
|
|
114
|
+
- bin/setup
|
|
115
|
+
- changelog.md
|
|
116
|
+
- chartmogul-ruby.gemspec
|
|
117
|
+
- fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_interracts_with_the_API.yml
|
|
118
|
+
- fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_404.yml
|
|
119
|
+
- fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_422.yml
|
|
120
|
+
- fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/adds_custom_attributes.yml
|
|
121
|
+
- fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/adds_required_tags.yml
|
|
122
|
+
- fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/raises_404_if_no_customers_found.yml
|
|
123
|
+
- fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/removes_custom_attributes.yml
|
|
124
|
+
- fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/removes_tags.yml
|
|
125
|
+
- fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/returns_all_customers_through_list_all_endpoint.yml
|
|
126
|
+
- fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/returns_customer_through_retrieve_endpoint.yml
|
|
127
|
+
- fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/returns_right_customers_through_search_endpoint.yml
|
|
128
|
+
- fixtures/vcr_cassettes/ChartMogul_Enrichment_Customer/API_Interactions/updates_custom_attributes.yml
|
|
129
|
+
- fixtures/vcr_cassettes/ChartMogul_Import_Customer/API_Interactions/correctly_handles_a_422_response.yml
|
|
130
|
+
- fixtures/vcr_cassettes/ChartMogul_Import_Customer/API_Interactions/correctly_interracts_with_the_API.yml
|
|
131
|
+
- fixtures/vcr_cassettes/ChartMogul_Import_CustomerInvoices/API_Interactions/correctly_interracts_with_the_API.yml
|
|
132
|
+
- fixtures/vcr_cassettes/ChartMogul_Import_DataSource/API_Interactions/correctly_interracts_with_the_API.yml
|
|
133
|
+
- fixtures/vcr_cassettes/ChartMogul_Import_DataSource/API_Interactions/correctly_raises_errors_on_404.yml
|
|
134
|
+
- fixtures/vcr_cassettes/ChartMogul_Import_DataSource/API_Interactions/correctly_raises_errors_on_422.yml
|
|
135
|
+
- fixtures/vcr_cassettes/ChartMogul_Import_Plan/API_Interractions/correctly_handles_a_422_error.yml
|
|
136
|
+
- fixtures/vcr_cassettes/ChartMogul_Import_Plan/API_Interractions/correctly_interracts_with_the_API.yml
|
|
137
|
+
- fixtures/vcr_cassettes/ChartMogul_Import_Subscription/API_Interactions/correctly_interracts_with_the_API.yml
|
|
138
|
+
- fixtures/vcr_cassettes/ChartMogul_Import_Transactions_Payment/API_Interactions/correctly_interracts_with_the_API.yml
|
|
139
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml
|
|
140
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/should_have_entries.yml
|
|
141
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml
|
|
142
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/should_have_entries.yml
|
|
143
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml
|
|
144
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/should_have_entries.yml
|
|
145
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/behaves_like_Pageable/should_be_pageable.yml
|
|
146
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/should_have_Activity_entries.yml
|
|
147
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_AllKeyMetric/should_have_entries.yml
|
|
148
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml
|
|
149
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml
|
|
150
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml
|
|
151
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/should_have_entries.yml
|
|
152
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml
|
|
153
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/should_have_entries.yml
|
|
154
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/behaves_like_Summary/should_have_summary.yml
|
|
155
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/should_have_entries.yml
|
|
156
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml
|
|
157
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml
|
|
158
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_Subscription/behaves_like_Pageable/should_be_pageable.yml
|
|
159
|
+
- fixtures/vcr_cassettes/ChartMogul_Metrics_Subscription/should_have_Subscription_entries.yml
|
|
160
|
+
- lib/chartmogul.rb
|
|
161
|
+
- lib/chartmogul/api/actions/all.rb
|
|
162
|
+
- lib/chartmogul/api/actions/create.rb
|
|
163
|
+
- lib/chartmogul/api/actions/custom.rb
|
|
164
|
+
- lib/chartmogul/api/actions/destroy.rb
|
|
165
|
+
- lib/chartmogul/api/actions/update.rb
|
|
166
|
+
- lib/chartmogul/api_resource.rb
|
|
167
|
+
- lib/chartmogul/concerns/entries.rb
|
|
168
|
+
- lib/chartmogul/concerns/pageable.rb
|
|
169
|
+
- lib/chartmogul/concerns/summary.rb
|
|
170
|
+
- lib/chartmogul/config_attributes.rb
|
|
171
|
+
- lib/chartmogul/configuration.rb
|
|
172
|
+
- lib/chartmogul/enrichment/customer.rb
|
|
173
|
+
- lib/chartmogul/errors/chartmogul_error.rb
|
|
174
|
+
- lib/chartmogul/errors/configuration_error.rb
|
|
175
|
+
- lib/chartmogul/errors/forbidden_error.rb
|
|
176
|
+
- lib/chartmogul/errors/not_found_error.rb
|
|
177
|
+
- lib/chartmogul/errors/resource_invalid_error.rb
|
|
178
|
+
- lib/chartmogul/errors/schema_invalid_error.rb
|
|
179
|
+
- lib/chartmogul/import/customer.rb
|
|
180
|
+
- lib/chartmogul/import/customer_invoices.rb
|
|
181
|
+
- lib/chartmogul/import/data_source.rb
|
|
182
|
+
- lib/chartmogul/import/invoice.rb
|
|
183
|
+
- lib/chartmogul/import/line_items/one_time.rb
|
|
184
|
+
- lib/chartmogul/import/line_items/subscription.rb
|
|
185
|
+
- lib/chartmogul/import/plan.rb
|
|
186
|
+
- lib/chartmogul/import/subscription.rb
|
|
187
|
+
- lib/chartmogul/import/transactions/payment.rb
|
|
188
|
+
- lib/chartmogul/import/transactions/refund.rb
|
|
189
|
+
- lib/chartmogul/metrics/activity.rb
|
|
190
|
+
- lib/chartmogul/metrics/all_key_metrics.rb
|
|
191
|
+
- lib/chartmogul/metrics/arpa.rb
|
|
192
|
+
- lib/chartmogul/metrics/arr.rb
|
|
193
|
+
- lib/chartmogul/metrics/asp.rb
|
|
194
|
+
- lib/chartmogul/metrics/base.rb
|
|
195
|
+
- lib/chartmogul/metrics/customer_churn_rate.rb
|
|
196
|
+
- lib/chartmogul/metrics/customer_count.rb
|
|
197
|
+
- lib/chartmogul/metrics/ltv.rb
|
|
198
|
+
- lib/chartmogul/metrics/mrr.rb
|
|
199
|
+
- lib/chartmogul/metrics/mrr_churn_rate.rb
|
|
200
|
+
- lib/chartmogul/metrics/subscription.rb
|
|
201
|
+
- lib/chartmogul/object.rb
|
|
202
|
+
- lib/chartmogul/resource_path.rb
|
|
203
|
+
- lib/chartmogul/summary.rb
|
|
204
|
+
- lib/chartmogul/utils/hash_snake_caser.rb
|
|
205
|
+
- lib/chartmogul/utils/json_parser.rb
|
|
206
|
+
- lib/chartmogul/version.rb
|
|
207
|
+
homepage: https://github.com/chartmogul/chartmogul-ruby
|
|
208
|
+
licenses:
|
|
209
|
+
- MIT
|
|
210
|
+
metadata: {}
|
|
211
|
+
post_install_message:
|
|
212
|
+
rdoc_options: []
|
|
213
|
+
require_paths:
|
|
214
|
+
- lib
|
|
215
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
216
|
+
requirements:
|
|
217
|
+
- - ">="
|
|
218
|
+
- !ruby/object:Gem::Version
|
|
219
|
+
version: '0'
|
|
220
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
221
|
+
requirements:
|
|
222
|
+
- - ">="
|
|
223
|
+
- !ruby/object:Gem::Version
|
|
224
|
+
version: '0'
|
|
225
|
+
requirements: []
|
|
226
|
+
rubyforge_project:
|
|
227
|
+
rubygems_version: 2.6.5
|
|
228
|
+
signing_key:
|
|
229
|
+
specification_version: 4
|
|
230
|
+
summary: Chartmogul API Ruby Client
|
|
231
|
+
test_files: []
|
|
232
|
+
has_rdoc:
|