stripe-cli 1.6.7 → 1.7.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9471f28432f1c177518637477dcc4c8f832acfff
4
- data.tar.gz: 3422689dcb2721571a4f4fe5341c51efc0cb007b
3
+ metadata.gz: b56072540c2f5ad6b7ace475d4debf8821926aa1
4
+ data.tar.gz: 1317da5bbdda008035c87667094354d56e93225b
5
5
  SHA512:
6
- metadata.gz: 7bfaa320421a692683eb23a8e4ac98bb02d850e27587fe77cfd0cb73103c50aabade182ac411541f805c7c4bbc639728befddb20d71188f898766b51628274be
7
- data.tar.gz: 735238f9fc5b523eed06c204dc036b38f2d12f8fb41a865be6ace148a20e66158c040665132b062c4b2241e67538e1de3e6c4cec7636fdc121a57f02f919ba5f
6
+ metadata.gz: aad9c62850f307a55e1cbf38460b377170ec3bf67de1833d800cef3a16d0cc68f71f5202c2fdf7f309229de6fa4b625fee104fe41ce4193a5a3492b5ce95e039
7
+ data.tar.gz: 2ef995bb4be67843f31af8ef4d7e3cd07c7d5f8f6af90f8edcbbe4de803e9dc6474455e0f519cdca99ca88ec1718a75ba6789b015b32543fe0871f90bfae3781
data/README.md CHANGED
@@ -12,8 +12,6 @@ Uses [AwesomePrint](https://github.com/michaeldv/awesome_print) to provide very
12
12
 
13
13
  ![example output](./output.png)
14
14
 
15
- Note that Date/Time stamps are converted automatically. No more Epoch/Unix timestamp garbage!
16
-
17
15
  ## Installation
18
16
 
19
17
  $ gem install stripe-cli
@@ -61,6 +59,12 @@ or, if you'd rather:
61
59
 
62
60
  If you choose to go this route, make sure to add `.stripecli` to your `.gitignore` files.
63
61
 
62
+ ### Date/Time
63
+
64
+ By default, Date/Time stamps are converted automatically to your local machine time. No more Epoch/Unix timestamp garbage!
65
+
66
+ If you'd prefer to have time Date/Time stamps to be converted to UTC time, set the config option `dates` or `-d` to `utc`. You can also set it to `unix` to see the original Unix timestamp passed from the API. By default, it uses `local`.
67
+
64
68
  ### Dollars vs. Cents
65
69
 
66
70
  By default stripe-cli expects currency amounts to be specified in **dollars**. This behavior maybe unexpected to veteran Stripe users since the raw API expects **cents**.
@@ -6,11 +6,13 @@ module Stripe
6
6
  @@root_config = ::File.expand_path('~/.stripecli')
7
7
  @@local_config = ::File.expand_path('./.stripecli')
8
8
 
9
- class_option :key, :aliases => :k, :desc => "One of your API secret keys, provided by Stripe"
10
- class_option :env, :aliases => :e, :desc => "This param expects a ~/.stripecli file with section headers for any string passed into it"
11
- class_option :version, :aliases => :v, :desc => "Stripe API version-date. Looks like `YYYY-MM-DD`"
9
+ class_option :key, :aliases => :k, :type => :string, :desc => "One of your API secret keys, provided by Stripe"
10
+ class_option :env, :aliases => :e, :type => :string, :desc => "This param expects a ~/.stripecli file with section headers for any string passed into it"
11
+ class_option :version, :aliases => :v, :type => :string, :desc => "Stripe API version-date. Looks like `YYYY-MM-DD`"
12
+ class_option :dates, :aliases => :d, :type => :string, :desc => "Date Style. It should be either local, utc, or unix. Defaults to local.", :enum => %w(local utc unix)
12
13
  class_option :dollar_amounts, :type => :boolean, :desc => "set expected currency units to dollars or cents"
13
14
 
15
+
14
16
  protected
15
17
 
16
18
  def api_key
@@ -25,6 +27,10 @@ module Stripe
25
27
  @env ||= options.delete(:env) || config['default']
26
28
  end
27
29
 
30
+ def dates
31
+ @dates ||= options.delete(:dates) || stored_api_option('dates')
32
+ end
33
+
28
34
  def dollar_amounts
29
35
  param_option = options.delete(:dollar_amounts)
30
36
  param_option.nil? ? stored_api_option('dollar_amounts') == 'false' ? false : true : param_option
@@ -84,7 +90,18 @@ module Stripe
84
90
  when Stripe::StripeObject
85
91
  inspect object.instance_variable_get(:@values)
86
92
  when Numeric
87
- object > 1000000000 ? Time.at( object ) : object
93
+ if object > 1000000000
94
+ case dates
95
+ when 'unix' then
96
+ object
97
+ when 'utc'
98
+ Time.at( object ).utc
99
+ else
100
+ Time.at( object )
101
+ end
102
+ else
103
+ object
104
+ end
88
105
  else
89
106
  object
90
107
  end
@@ -1,5 +1,5 @@
1
1
  module Stripe
2
2
  module CLI
3
- VERSION = "1.6.7"
3
+ VERSION = "1.7.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.7
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex MacCaw
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-12 00:00:00.000000000 Z
12
+ date: 2015-03-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -190,7 +190,6 @@ files:
190
190
  - spec/commands/recipient_spec.rb
191
191
  - spec/dollar_amounts_spec.rb
192
192
  - spec/spec_helper.rb
193
- - stripe-cli.1
194
193
  - stripe-cli.gemspec
195
194
  homepage: https://stripe.com
196
195
  licenses:
@@ -212,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
211
  version: '0'
213
212
  requirements: []
214
213
  rubyforge_project:
215
- rubygems_version: 2.4.2
214
+ rubygems_version: 2.4.5
216
215
  signing_key:
217
216
  specification_version: 4
218
217
  summary: Command line interface to Stripe
data/stripe-cli.1 DELETED
@@ -1 +0,0 @@
1
- stripe-cli(1) --