peat 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3bd362a4bcd5fe1dbf4b17de3d4b5a5296002b62
4
+ data.tar.gz: da5c623043a14c74c391fb470888fab6f8282a6d
5
+ SHA512:
6
+ metadata.gz: f81f516b96f4ac34603a8716eb0679e5c6fc82a4b98bdd956525f7401b50e6113cd132652f76b2dde09d9fa926b2046c95196e48e84d2dd6d166b941e171e129
7
+ data.tar.gz: 055f25d88db3ebaee90398b12872636f4d467878938c28652f785e48f49b9e042e624cf42877c28e3ab7c4b773ab48d2cce673e33537703aa4ff4a66aef91512
data/README.md CHANGED
@@ -19,9 +19,18 @@ Or install it yourself as:
19
19
 
20
20
  ## Usage
21
21
 
22
- The Peat::TokenManager class depends on two global variables being set -- $fuel_client_id and $fuel_secret.
22
+ The Peat::TokenManager class depends on the gem-including app to set up a client id and secret for the Fuel API.
23
+ The gem will look for the these values in one of two places, ENV['FUEL_CLIENT_ID'] or $fuel_client_id and ENV['FUEL_SECRET'] or $fuel_secret,
24
+ for the fuel client id and secret respectively. Note if both the enviornment and global are set, the environment variable takes precedence.
23
25
 
24
- If you're using a rails app, this could be added to config/initializers/peat.rb
26
+ If you're using a rails app, this could be configured in an intializer, e.g. config/initializers/peat.rb
27
+
28
+ ```
29
+ ENV['FUEL_CLIENT_ID'] = 'yourclientid'
30
+ ENV['FUEL_SECRET'] = 'yoursecret'
31
+ ```
32
+
33
+ or
25
34
 
26
35
  ```
27
36
  $fuel_client_id = 'yourclientid'
@@ -47,7 +56,8 @@ mail_params = {
47
56
  }
48
57
  }
49
58
  }
50
- peat_client = Peat::Client.deliver('name_of_my_triggered_send', mail_params')
59
+ peat_client = Peat::Client.deliver('name_of_my_triggered_send', mail_params)
60
+ ```
51
61
 
52
62
  ## Contributing
53
63
 
@@ -8,8 +8,8 @@ module Peat
8
8
  req.url 'requestToken'
9
9
  req.headers['Content-Type'] = 'application/json'
10
10
  req.body = {
11
- 'clientId' => $fuel_client_id,
12
- 'clientSecret' => $fuel_secret,
11
+ 'clientId' => ENV['FUEL_CLIENT_ID'] || $fuel_client_id,
12
+ 'clientSecret' => ENV['FUEL_SECRET'] || $fuel_secret,
13
13
  }.to_json
14
14
  end.body.merge('created_at' => Time.now)
15
15
  end
data/lib/peat/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Peat
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -1,4 +1,5 @@
1
1
  require 'peat'
2
+ require 'active_support'
2
3
  require 'active_support/core_ext'
3
4
 
4
5
  module Peat
metadata CHANGED
@@ -1,94 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
5
- prerelease:
4
+ version: 0.0.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Hubert Huang
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-06-17 00:00:00.000000000 Z
11
+ date: 2015-04-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: faraday
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: activesupport
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: bundler
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ~>
59
+ - - "~>"
68
60
  - !ruby/object:Gem::Version
69
61
  version: '1.6'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ~>
66
+ - - "~>"
76
67
  - !ruby/object:Gem::Version
77
68
  version: '1.6'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rake
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - ">="
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - ">="
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  description: Wrapper for the Exact Target fuel api
@@ -98,7 +87,7 @@ executables: []
98
87
  extensions: []
99
88
  extra_rdoc_files: []
100
89
  files:
101
- - .gitignore
90
+ - ".gitignore"
102
91
  - Gemfile
103
92
  - LICENSE.txt
104
93
  - README.md
@@ -112,27 +101,26 @@ files:
112
101
  homepage: ''
113
102
  licenses:
114
103
  - MIT
104
+ metadata: {}
115
105
  post_install_message:
116
106
  rdoc_options: []
117
107
  require_paths:
118
108
  - lib
119
109
  required_ruby_version: !ruby/object:Gem::Requirement
120
- none: false
121
110
  requirements:
122
- - - ! '>='
111
+ - - ">="
123
112
  - !ruby/object:Gem::Version
124
113
  version: '0'
125
114
  required_rubygems_version: !ruby/object:Gem::Requirement
126
- none: false
127
115
  requirements:
128
- - - ! '>='
116
+ - - ">="
129
117
  - !ruby/object:Gem::Version
130
118
  version: '0'
131
119
  requirements: []
132
120
  rubyforge_project:
133
- rubygems_version: 1.8.23.2
121
+ rubygems_version: 2.4.5
134
122
  signing_key:
135
- specification_version: 3
123
+ specification_version: 4
136
124
  summary: Wrapper for the Exact Target fuel api
137
125
  test_files:
138
126
  - spec/token_manager_spec.rb