colt 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +7 -4
- data/lib/colt.rb +25 -2
- data/lib/colt/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c5d73e891b2f0412d78739cd323dbe5167419e7
|
4
|
+
data.tar.gz: e36a531b53218467ce3b134a1e7db8422a60295a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 902ac8b8b55891534b648911eaeb93c40bf68b9948f64f8fdc5728f3f24f5ab0fd83e53501e43ee4129fc34d465f8201c07c75740dad432c17de537eb0c4018e
|
7
|
+
data.tar.gz: 97c12932a77cd8d4d63177153536619e449799e85e953164f9725c065cfbacd552c87883d0c10b0fd342388a7315a16516ba7d1400f813818923aa5481eeeb64
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Colt
|
2
2
|
|
3
|
-
|
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
|
-
|
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
|
-
|
5
|
-
|
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
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.
|
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-
|
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
|