colt 0.1.0 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc04e62d1f0a113e86bd957758397a2119fdd01b
4
- data.tar.gz: 99987b8518fbb3fd65178b21d091619c8f1bc0ac
3
+ metadata.gz: 3c5d73e891b2f0412d78739cd323dbe5167419e7
4
+ data.tar.gz: e36a531b53218467ce3b134a1e7db8422a60295a
5
5
  SHA512:
6
- metadata.gz: 18604d2b4e3d017e132bc549fd0b66ba6c8458dfe2b619f7347da55fdeb45089aaddf19b48357bdeba0cdc9bcad4716ac6eb021312f57f96c43c2c4ab91bd67e
7
- data.tar.gz: 07f8ff7b5feb7a16f4d8add92e011d3d2230129ee68edd85e32f2e896bae2f9ce9d34e3546c886894cd1fe8afe03dd6873e67c232054246367b95cbe587b740f
6
+ metadata.gz: 902ac8b8b55891534b648911eaeb93c40bf68b9948f64f8fdc5728f3f24f5ab0fd83e53501e43ee4129fc34d465f8201c07c75740dad432c17de537eb0c4018e
7
+ data.tar.gz: 97c12932a77cd8d4d63177153536619e449799e85e953164f9725c065cfbacd552c87883d0c10b0fd342388a7315a16516ba7d1400f813818923aa5481eeeb64
data/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+ == Version 0.1.1 on July 2, 2015
2
+
3
+ - Check for Stripe API version
4
+ - Check for Stripe credentials
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Colt
2
2
 
3
- This micro gem is used to subscribe to a given plan using the Stripe API. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Colt is a micro gem used to subscribe to a given plan using the Stripe API. The plans must already exist in your account. To experiment with that code, run `bin/console` for an interactive prompt.
4
4
 
5
5
  ## Installation
6
6
 
@@ -20,19 +20,22 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- TODO: Write usage instructions here
23
+ Please read the tests written with readability in mind. They are executable and human comprehensible documentation.
24
24
 
25
25
  ## Development
26
26
 
27
27
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
28
28
 
29
- 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).
29
+ 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). To run the tests:
30
30
 
31
+ ```ruby
32
+ $ruby test/colt_test.rb
33
+ ```
34
+
31
35
  ## Contributing
32
36
 
33
37
  Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/colt.
34
38
 
35
-
36
39
  ## License
37
40
 
38
41
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/lib/colt.rb CHANGED
@@ -1,5 +1,28 @@
1
1
  require "colt/version"
2
+ require "stripe"
2
3
 
3
4
  module Colt
4
- # Your code goes here...
5
- end
5
+ STRIPE_API_VERSION = '2015-06-15 (latest)'
6
+
7
+ class Credential
8
+ def self.check
9
+ message = <<ERROR
10
+ Stripe credentials is not set properly or it is incorrect.
11
+ Define the following Stripe environment variables.
12
+
13
+ export STRIPE_PUBLISHABLE_KEY='pk_test your publishable key'
14
+ export STRIPE_SECRET_KEY='sk_test your secret key'
15
+
16
+ and define:
17
+
18
+ Stripe.api_key = 'sk_test your secret key'
19
+ ERROR
20
+ begin
21
+ ::Stripe::Account.retrieve
22
+ rescue ::Stripe::AuthenticationError => e
23
+ raise Exception.new(message)
24
+ end
25
+ end
26
+ end
27
+
28
+ end
data/lib/colt/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Colt
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: colt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bala Paranj
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-07-02 00:00:00.000000000 Z
11
+ date: 2015-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: stripe
@@ -78,6 +78,7 @@ files:
78
78
  - ".ruby-gemset"
79
79
  - ".ruby-version"
80
80
  - ".travis.yml"
81
+ - CHANGELOG.md
81
82
  - Gemfile
82
83
  - LICENSE.txt
83
84
  - README.md