gmail_cli 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MDg5MjU0MTQ2NGU0NDM2MTU5NjliMGE0NzU0NmYwNzA0MTRhYzc5ZQ==
5
+ data.tar.gz: !binary |-
6
+ NzQzNWJkM2QwNGU0NzQ5OTYyMTNmYjllYjE1YzY3ZjNmZTRiNGY3YQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ NDM3ZWY3NTZiOTQwOTBlNGM4OTdhY2EwOGQ5ZjY0NTgwZmIwOTJmODY0NTU5
10
+ NWJkODVjNjJiZjIwYWFlNWJlMjYyNjc1ZGY3MTU4Mjc4NzViNGE3ZDc4YjM0
11
+ ZjkwZDc5NzZmYWQyOTkzMjMyZjUzOTE3MjBmZTcxMjlkNTFiNTQ=
12
+ data.tar.gz: !binary |-
13
+ Yzk5ODkyMTI3NTc1MTAyN2Y5MmU2NmUwZjZjZmM2NTFiNDNiNTFiYWFlYjZm
14
+ MzI2YTJjYzBjN2YyNDc5NWNkOGM2MjVjYTI3YzQxYTM5ZDgyNmIzNDRiYmM5
15
+ ZDkxNWJjNjI4ZmUwOWMzYThhNGVlM2EwYzE4ZDk2NzEwYWI5M2U=
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
18
  .rvmrc
19
+ .ruby-*
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --colour
@@ -0,0 +1,11 @@
1
+ # These are specific configuration settings required for travis-ci
2
+ # see http://travis-ci.org/evendis/gmail_cli
3
+ language: ruby
4
+ rvm:
5
+ # - 1.8.7
6
+ - 1.9.2
7
+ - 1.9.3
8
+ # - rbx-18mode
9
+ # - rbx-19mode
10
+ # - jruby-18mode
11
+ # - jruby-19mode
data/Guardfile CHANGED
@@ -1,7 +1,7 @@
1
1
  # A sample Guardfile
2
2
  # More info at https://github.com/guard/guard#readme
3
3
 
4
- guard 'rspec', :version => 2, :all_on_start => false, :all_after_pass => false do
4
+ guard :rspec, cmd: 'bundle exec rspec', all_on_start: false, all_after_pass: false do
5
5
  watch(%r{^spec/.+_spec\.rb$})
6
6
  watch(%r{^lib/gmail_cli/(.+)\.rb$}) { |m| "spec/unit/#{m[1]}_spec.rb" }
7
7
  watch('spec/spec_helper.rb') { "spec" }
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # GmailCli
1
+ # GmailCli [![Build Status](https://secure.travis-ci.org/evendis/gmail_cli.png?branch=master)](http://travis-ci.org/evendis/gmail_cli)
2
2
 
3
3
  GmailCli packages the key tools and adds a sprinkling of goodness to make it just that much easier
4
4
  to write primarily command-line utilities for Gmail/GoogleApps.
@@ -31,7 +31,7 @@ Or install it yourself as:
31
31
 
32
32
  There are three basic steps required:
33
33
 
34
- 1. Create your API project credntials in the [Google APIs console](https://code.google.com/apis/console/), from the "API Access" tab.
34
+ 1. Create your API project credentials in the [Google APIs console](https://code.google.com/apis/console/), from the "API Access" tab.
35
35
 
36
36
  2. Authorize your credentials to access a specific account.
37
37
  This requires human intervention to explicitly make the approval.
@@ -45,37 +45,39 @@ without manual intervention so you don't have to keep going back to step 2 each
45
45
 
46
46
  ### How to authorize your OAuth2 credentials - command line approach
47
47
 
48
- $ gmail_cli authorize
48
+ $ gmail_cli authorize
49
49
 
50
50
  This will prompt you for required information (client_id, client_secret), or you can provide on the command line:
51
51
 
52
- $ gmail_cli authorize --client_id 'my id' --client_secret 'my secret'
52
+ $ gmail_cli authorize --client_id 'my id' --client_secret 'my secret'
53
53
 
54
54
 
55
55
  ### How to authorize your OAuth2 credentials - Rake approach
56
56
 
57
57
  In your Rakefile, include the line:
58
58
 
59
- require 'gmail_cli/tasks'
59
+ require 'gmail_cli/tasks'
60
60
 
61
61
  Then from the command line you can:
62
62
 
63
- $ rake gmail_cli:authorize
63
+ $ rake gmail_cli:authorize
64
64
 
65
65
  This will prompt you for required information (client_id, client_secret), or you can provide on the command line:
66
66
 
67
- $ rake gmail_cli:authorize client_id='my id' client_secret='my secret'
67
+ $ rake gmail_cli:authorize client_id='my id' client_secret='my secret'
68
68
 
69
69
 
70
70
  ### How to get an OAuth2-authorised IMAP connection to Gmail:
71
71
 
72
- # how you store or set the credentials Hash is up to you, but it should have the following keys:
73
- credentials = {
74
- client_id: 'xxxx',
75
- client_secret: 'yyyy',
76
- refresh_token: 'zzzz'
77
- }
78
- imap = GmailCli.imap_connection(credentials)
72
+ # how you store or set the credentials Hash is up to you, but it should have the following keys:
73
+ credentials = {
74
+ client_id: 'xxxx',
75
+ client_secret: 'yyyy',
76
+ access_token: 'aaaa',
77
+ refresh_token: 'rrrr',
78
+ username: 'name@gmail.com'
79
+ }
80
+ imap = GmailCli.imap_connection(credentials)
79
81
 
80
82
  On return, <tt>imap</tt> will either be an open Net::IMAP connection, or an error will have been raised. Possible exceptions include:
81
83
 
data/Rakefile CHANGED
@@ -11,14 +11,6 @@ end
11
11
 
12
12
  task :default => :spec
13
13
 
14
- require 'rdoc/task'
15
- RDoc::Task.new do |rdoc|
16
- rdoc.main = "README.md"
17
- rdoc.rdoc_dir = 'rdoc'
18
- rdoc.title = "Gmail CLI"
19
- rdoc.rdoc_files.include('README*', 'lib/**/*.rb')
20
- end
21
-
22
14
  desc "Open an irb session preloaded with this library"
23
15
  task :console do
24
16
  sh "irb -rubygems -I lib -r gmail_cli.rb"
@@ -18,15 +18,13 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_runtime_dependency(%q<getoptions>, ["~> 0.3"])
22
- spec.add_runtime_dependency(%q<gmail_xoauth>, ["~> 0.4.1"])
23
- spec.add_runtime_dependency(%q<google-api-client>, ["~> 0.6.4"])
21
+ spec.add_runtime_dependency 'getoptions', "~> 0.3"
22
+ spec.add_runtime_dependency 'gmail_xoauth', "~> 0.4.1"
23
+ spec.add_runtime_dependency 'google-api-client', "~> 0.7"
24
24
 
25
- spec.add_development_dependency(%q<bundler>, ["> 1.3"])
26
- spec.add_development_dependency(%q<rake>, ["~> 0.9.2.2"])
27
- spec.add_development_dependency(%q<rspec>, ["~> 2.13.0"])
28
- spec.add_development_dependency(%q<rdoc>, ["~> 3.11"])
29
- spec.add_development_dependency(%q<guard-rspec>, ["~> 3.0.2"])
30
- spec.add_development_dependency(%q<rb-fsevent>, ["~> 0.9.3"])
25
+ spec.add_development_dependency "bundler", "~> 1.6"
26
+ spec.add_development_dependency "rake"
27
+ spec.add_development_dependency "rspec", "~> 3.0"
28
+ spec.add_development_dependency "guard-rspec"
31
29
 
32
30
  end
@@ -1,3 +1,3 @@
1
1
  module GmailCli
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -5,83 +5,80 @@ describe GmailCli do
5
5
 
6
6
  describe "##imap_connection" do
7
7
  subject { GmailCli.imap_connection(options) }
8
- it "should return connected GmailCli::Imap" do
9
- GmailCli::Imap.any_instance.should_receive(:connect!).and_return('result!')
10
- should eql('result!')
8
+ it "returns a connected GmailCli::Imap" do
9
+ expect_any_instance_of(GmailCli::Imap).to receive(:connect!).and_return('result!')
10
+ expect(subject).to eql('result!')
11
11
  end
12
12
  end
13
13
 
14
14
  describe "::Imap" do
15
15
  let(:imap) { GmailCli::Imap.new(options) }
16
16
  subject { imap }
17
+ it "has the expected default settings" do
18
+ expect(subject.username).to be_nil
19
+ expect(subject.host).to eql('imap.gmail.com')
20
+ expect(subject.host_options).to eql({port: 993, ssl: true})
21
+ end
17
22
 
18
23
  describe "#username" do
19
- subject { imap.username }
20
- it { should be_nil }
21
- context "when given in options" do
22
- let(:expected) { 'test@test.com' }
23
- let(:options) { {username: expected} }
24
- it { should eql(expected) }
24
+ let(:expected) { 'test@test.com' }
25
+ let(:options) { {username: expected} }
26
+ it "can be set through options" do
27
+ expect(subject.username).to eql(expected)
25
28
  end
26
29
  end
27
30
 
28
31
  describe "#host" do
29
- subject { imap.host }
30
- it { should eql('imap.gmail.com') }
31
- context "when given in options" do
32
- let(:expected) { 'test.com' }
33
- let(:options) { {host: expected} }
34
- it { should eql(expected) }
32
+ let(:expected) { 'test.com' }
33
+ let(:options) { {host: expected} }
34
+ it "can be set through options" do
35
+ expect(subject.host).to eql(expected)
35
36
  end
36
37
  end
37
38
 
38
39
  describe "#host_options" do
39
- subject { imap.host_options }
40
- it { should eql({port: 993, ssl: true}) }
41
- context "when given in options" do
42
- let(:expected) { {port: 111} }
43
- let(:options) { {host_options: expected} }
44
- it { should eql(expected) }
40
+ let(:expected) { {port: 111} }
41
+ let(:options) { {host_options: expected} }
42
+ it "can be set through options" do
43
+ expect(subject.host_options).to eql(expected)
45
44
  end
46
45
  end
47
46
 
48
47
  describe "#oauth_options" do
49
- subject { imap.oauth_options }
50
- it { should eql({
51
- client_id: nil,
52
- client_secret: nil,
53
- access_token: nil,
54
- refresh_token: nil
55
- }) }
56
- context "when some given in options" do
57
- let(:options) { {client_id: 'abcd'} }
58
- it { should eql({
59
- client_id: 'abcd',
48
+ it "is all nil by default" do
49
+ expect(subject.oauth_options).to eql({
50
+ client_id: nil,
60
51
  client_secret: nil,
61
52
  access_token: nil,
62
53
  refresh_token: nil
63
- }) }
54
+ })
55
+ end
56
+ context "when some given in options" do
57
+ let(:options) { {client_id: 'abcd'} }
58
+ it "sets selected items correctly" do
59
+ expect(subject.oauth_options).to eql({
60
+ client_id: 'abcd',
61
+ client_secret: nil,
62
+ access_token: nil,
63
+ refresh_token: nil
64
+ })
65
+ end
64
66
  end
65
67
  context "when all given in options" do
66
68
  let(:options) { {client_id: 'abcd', client_secret: 'efg', access_token: '123', refresh_token: '456'} }
67
- it { should eql({
69
+ it "sets all items correctly" do
70
+ expect(subject.oauth_options).to eql({
68
71
  client_id: 'abcd',
69
72
  client_secret: 'efg',
70
73
  access_token: '123',
71
74
  refresh_token: '456'
72
- }) }
73
- it "should not be included in the options" do
74
- imap.options.keys.should_not include(:client_id)
75
- end
76
- describe "#oauth_access_token" do
77
- subject { imap.oauth_access_token }
78
- it { should eql('123') }
75
+ })
76
+ expect(subject.options.keys).to_not include(:client_id)
77
+ expect(subject.oauth_access_token).to eql('123')
79
78
  end
80
79
  end
81
80
  end
82
81
 
83
-
84
-
85
82
  end
86
83
 
87
84
  end
@@ -4,22 +4,22 @@ describe GmailCli::Logger do
4
4
  let(:logger) { GmailCli::Logger }
5
5
  let(:trace_something) { logger.trace 'somthing', 'bogative' }
6
6
 
7
- it "should not log when verbose mode not enabled" do
8
- $stderr.should_receive(:puts).never
7
+ it "does not log when verbose mode not enabled" do
8
+ expect($stderr).to receive(:puts).never
9
9
  trace_something
10
10
  end
11
11
 
12
- it "should log when verbose mode enabled" do
12
+ it "logs when verbose mode enabled" do
13
13
  logger.set_log_mode(true)
14
- $stderr.should_receive(:puts).and_return(nil)
14
+ expect($stderr).to receive(:puts).and_return(nil)
15
15
  trace_something
16
16
  logger.set_log_mode(false)
17
17
  end
18
18
 
19
- it "should not log when verbose mode enabled then disabled" do
19
+ it "does not log when verbose mode enabled then disabled" do
20
20
  logger.set_log_mode(true)
21
21
  logger.set_log_mode(false)
22
- $stderr.should_receive(:puts).never
22
+ expect($stderr).to receive(:puts).never
23
23
  trace_something
24
24
  end
25
25
 
@@ -8,38 +8,48 @@ describe GmailCli::Oauth2Helper do
8
8
 
9
9
  before do
10
10
  # silence echo
11
- resource_class.any_instance.stub(:echo).and_return(nil)
11
+ allow_any_instance_of(resource_class).to receive(:echo).and_return(nil)
12
12
  end
13
13
 
14
14
  describe "##authorize!" do
15
15
  subject { resource_class.authorize!(options) }
16
- it "should invoke authorize! on instance" do
17
- resource_class.any_instance.should_receive(:authorize!).and_return('result!')
18
- should eql('result!')
16
+ it "invokes authorize! on instance" do
17
+ expect_any_instance_of(resource_class).to receive(:authorize!).and_return('result!')
18
+ expect(subject).to eql('result!')
19
19
  end
20
20
  end
21
21
 
22
22
  describe "#client_id" do
23
23
  subject { instance.client_id }
24
- it { should be_nil }
24
+ it "is nil by default" do
25
+ expect(subject).to be_nil
26
+ end
25
27
  context "when given in options" do
26
28
  let(:options) { {client_id: expected} }
27
- it { should eql(expected) }
29
+ it "returns the setting" do
30
+ expect(subject).to eql(expected)
31
+ end
28
32
  end
29
33
  end
30
34
 
31
35
  describe "#client_secret" do
32
36
  subject { instance.client_secret }
33
- it { should be_nil }
37
+ it "is nil by default" do
38
+ expect(subject).to be_nil
39
+ end
34
40
  context "when given in options" do
35
41
  let(:options) { {client_secret: expected} }
36
- it { should eql(expected) }
42
+ it "returns the setting" do
43
+ expect(subject).to eql(expected)
44
+ end
37
45
  end
38
46
  end
39
47
 
40
48
  describe "#authorization_code" do
41
49
  subject { instance.authorization_code }
42
- it { should be_nil }
50
+ it "is nil by default" do
51
+ expect(subject).to be_nil
52
+ end
43
53
  context "cannot be given in options" do
44
54
  let(:options) { {authorization_code: expected} }
45
55
  it { should be_nil }
@@ -48,55 +58,79 @@ describe GmailCli::Oauth2Helper do
48
58
 
49
59
  describe "#access_token" do
50
60
  subject { instance.access_token }
51
- it { should be_nil }
61
+ it "is nil by default" do
62
+ expect(subject).to be_nil
63
+ end
52
64
  context "when given in options" do
53
65
  let(:options) { {access_token: expected} }
54
- it { should eql(expected) }
66
+ it "returns the setting" do
67
+ expect(subject).to eql(expected)
68
+ end
55
69
  end
56
70
  end
57
71
 
58
72
  describe "#refresh_token" do
59
73
  subject { instance.refresh_token }
60
- it { should be_nil }
74
+ it "is nil by default" do
75
+ expect(subject).to be_nil
76
+ end
61
77
  context "when given in options" do
62
78
  let(:options) { {refresh_token: expected} }
63
- it { should eql(expected) }
79
+ it "returns the setting" do
80
+ expect(subject).to eql(expected)
81
+ end
64
82
  end
65
83
  end
66
84
 
67
85
  describe "#scope" do
68
86
  subject { instance.scope }
69
- it { should eql('https://mail.google.com/') }
87
+ it "is set by default" do
88
+ expect(subject).to eql('https://mail.google.com/')
89
+ end
70
90
  context "when given in options" do
71
91
  let(:options) { {scope: expected} }
72
- it { should eql(expected) }
92
+ it "returns the setting" do
93
+ expect(subject).to eql(expected)
94
+ end
73
95
  end
74
96
  end
75
97
 
76
98
  describe "#redirect_uri" do
77
99
  subject { instance.redirect_uri }
78
- it { should eql('urn:ietf:wg:oauth:2.0:oob') }
100
+ it "is set by default" do
101
+ expect(subject).to eql('urn:ietf:wg:oauth:2.0:oob')
102
+ end
79
103
  context "when given in options" do
80
104
  let(:options) { {redirect_uri: expected} }
81
- it { should eql(expected) }
105
+ it "returns the setting" do
106
+ expect(subject).to eql(expected)
107
+ end
82
108
  end
83
109
  end
84
110
 
85
111
  describe "#application_name" do
86
112
  subject { instance.application_name }
87
- it { should eql('gmail_cli') }
113
+ it "is set by default" do
114
+ expect(subject).to eql('gmail_cli')
115
+ end
88
116
  context "when given in options" do
89
117
  let(:options) { {application_name: expected} }
90
- it { should eql(expected) }
118
+ it "returns the setting" do
119
+ expect(subject).to eql(expected)
120
+ end
91
121
  end
92
122
  end
93
123
 
94
124
  describe "#application_version" do
95
125
  subject { instance.application_version }
96
- it { should eql(GmailCli::VERSION) }
126
+ it "is set by default" do
127
+ expect(subject).to eql(GmailCli::VERSION)
128
+ end
97
129
  context "when given in options" do
98
130
  let(:options) { {application_version: expected} }
99
- it { should eql(expected) }
131
+ it "returns the setting" do
132
+ expect(subject).to eql(expected)
133
+ end
100
134
  end
101
135
  end
102
136
 
@@ -106,13 +140,13 @@ describe GmailCli::Oauth2Helper do
106
140
  context "when value already set" do
107
141
  let(:options) { {client_id: 'set'} }
108
142
  it "should not ask_for_entry when already set" do
109
- instance.should_receive(:ask_for_entry).never
143
+ expect(instance).to receive(:ask_for_entry).never
110
144
  subject
111
145
  end
112
146
  end
113
147
  context "when value not already set" do
114
148
  it "should ask_for_entry when already set" do
115
- instance.should_receive(:ask_for_entry).and_return('got it')
149
+ expect(instance).to receive(:ask_for_entry).and_return('got it')
116
150
  subject
117
151
  end
118
152
  end
@@ -120,8 +154,8 @@ describe GmailCli::Oauth2Helper do
120
154
 
121
155
  describe "#authorize!" do
122
156
  subject { instance.authorize! }
123
- it "should get_access_token" do
124
- instance.should_receive(:get_access_token!).and_return(nil)
157
+ it "invokes get_access_token" do
158
+ expect(instance).to receive(:get_access_token!).and_return(nil)
125
159
  subject
126
160
  end
127
161
  end
@@ -129,7 +163,9 @@ describe GmailCli::Oauth2Helper do
129
163
  describe "#api_client" do
130
164
  let(:options) { {client_id: 'client_id', client_secret: 'client_secret'} }
131
165
  subject { instance.api_client }
132
- it { should be_a(Google::APIClient) }
166
+ it "returns an initialised Google API client" do
167
+ expect(subject).to be_a(Google::APIClient)
168
+ end
133
169
  end
134
170
 
135
171
  describe "#get_access_token!" do
@@ -138,14 +174,14 @@ describe GmailCli::Oauth2Helper do
138
174
  let(:mock_refresh_token) { "ya29.AHES6ZS_KHUpdO5P0nyvADWf4tL5o8e8C_q5UK0HyyYOF3jw" }
139
175
  let(:mock_fetch_access_token_response) { {"access_token"=>mock_access_token, "token_type"=>"Bearer", "expires_in"=>3600, "refresh_token"=>mock_refresh_token} }
140
176
  subject { instance.get_access_token! }
141
- it "should orchestrate the fetch_access_token process correctly" do
142
- instance.api_client.should be_a(Google::APIClient)
143
- instance.should_receive(:get_authorization_uri).and_return('http://here')
144
- instance.should_receive(:ensure_provided).with(:authorization_code).and_return('authorization_code')
145
- instance.should_receive(:fetch_access_token!).and_return(mock_fetch_access_token_response)
146
- subject.should eql(mock_access_token)
147
- instance.access_token.should eql(mock_access_token)
148
- instance.refresh_token.should eql(mock_refresh_token)
177
+ it "orchestrates the fetch_access_token process correctly" do
178
+ expect(instance.api_client).to be_a(Google::APIClient)
179
+ expect(instance).to receive(:get_authorization_uri).and_return('http://here')
180
+ expect(instance).to receive(:ensure_provided).with(:authorization_code).and_return('authorization_code')
181
+ expect(instance).to receive(:fetch_access_token!).and_return(mock_fetch_access_token_response)
182
+ expect(subject).to eql(mock_access_token)
183
+ expect(instance.access_token).to eql(mock_access_token)
184
+ expect(instance.refresh_token).to eql(mock_refresh_token)
149
185
  end
150
186
  end
151
187
 
@@ -155,12 +191,12 @@ describe GmailCli::Oauth2Helper do
155
191
  let(:mock_refresh_token) { "ya29.AHES6ZS_KHUpdO5P0nyvADWf4tL5o8e8C_q5UK0HyyYOF3jw" }
156
192
  let(:mock_fetch_refresh_token_response) { {"access_token"=>mock_access_token, "token_type"=>"Bearer", "expires_in"=>3600} }
157
193
  subject { instance.refresh_access_token! }
158
- it "should orchestrate the fetch_access_token process correctly" do
159
- instance.api_client.should be_a(Google::APIClient)
160
- instance.should_receive(:fetch_refresh_token!).and_return(mock_fetch_refresh_token_response)
161
- subject.should eql(mock_access_token)
162
- instance.access_token.should eql(mock_access_token)
163
- instance.refresh_token.should eql(mock_refresh_token)
194
+ it "orchestrates the fetch_access_token process correctly" do
195
+ expect(instance.api_client).to be_a(Google::APIClient)
196
+ expect(instance).to receive(:fetch_refresh_token!).and_return(mock_fetch_refresh_token_response)
197
+ expect(subject).to eql(mock_access_token)
198
+ expect(instance.access_token).to eql(mock_access_token)
199
+ expect(instance.refresh_token).to eql(mock_refresh_token)
164
200
  end
165
201
  end
166
202
 
@@ -7,14 +7,14 @@ describe GmailCli::Shell do
7
7
  let(:shell) { GmailCli::Shell.new(getoptions,argv) }
8
8
 
9
9
  before do
10
- $stderr.stub(:puts) # silence console feedback chatter
10
+ allow($stderr).to receive(:puts) # silence console feedback chatter
11
11
  end
12
12
 
13
13
  describe "#usage" do
14
14
  let(:options) { ['-h'] }
15
15
  let(:argv) { [] }
16
- it "should print usage when run" do
17
- shell.should_receive(:usage)
16
+ it "prints usage when run" do
17
+ expect(shell).to receive(:usage)
18
18
  shell.run
19
19
  end
20
20
  end
@@ -23,7 +23,7 @@ describe GmailCli::Shell do
23
23
  let(:options) { [] }
24
24
  let(:argv) { ["authorize"] }
25
25
  it "should invoke authorize when run" do
26
- GmailCli::Oauth2Helper.should_receive(:authorize!)
26
+ expect(GmailCli::Oauth2Helper).to receive(:authorize!)
27
27
  shell.run
28
28
  end
29
29
  end
@@ -11,8 +11,8 @@ describe "Rake Task gmail_cli:" do
11
11
  Rake.application.invoke_task task_name
12
12
  end
13
13
 
14
- it "should run successfully" do
15
- GmailCli::Oauth2Helper.any_instance.should_receive(:authorize!).and_return(nil)
14
+ it "runs successfully" do
15
+ expect_any_instance_of(GmailCli::Oauth2Helper).to receive(:authorize!).and_return(nil)
16
16
  expect { run_rake_task }.to_not raise_error
17
17
  end
18
18
 
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gmail_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
5
- prerelease:
4
+ version: 0.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Paul Gallagher
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-06-23 00:00:00.000000000 Z
11
+ date: 2015-07-03 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: getoptions
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
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
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: gmail_xoauth
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
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
@@ -46,115 +41,73 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: google-api-client
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
53
- version: 0.6.4
47
+ version: '0.7'
54
48
  type: :runtime
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
- version: 0.6.4
54
+ version: '0.7'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: bundler
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ! '>'
68
- - !ruby/object:Gem::Version
69
- version: '1.3'
70
- type: :development
71
- prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>'
76
- - !ruby/object:Gem::Version
77
- version: '1.3'
78
- - !ruby/object:Gem::Dependency
79
- name: rake
80
- requirement: !ruby/object:Gem::Requirement
81
- none: false
82
58
  requirements:
83
59
  - - ~>
84
60
  - !ruby/object:Gem::Version
85
- version: 0.9.2.2
61
+ version: '1.6'
86
62
  type: :development
87
63
  prerelease: false
88
64
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
65
  requirements:
91
66
  - - ~>
92
67
  - !ruby/object:Gem::Version
93
- version: 0.9.2.2
68
+ version: '1.6'
94
69
  - !ruby/object:Gem::Dependency
95
- name: rspec
70
+ name: rake
96
71
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
72
  requirements:
99
- - - ~>
73
+ - - ! '>='
100
74
  - !ruby/object:Gem::Version
101
- version: 2.13.0
75
+ version: '0'
102
76
  type: :development
103
77
  prerelease: false
104
78
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
79
  requirements:
107
- - - ~>
80
+ - - ! '>='
108
81
  - !ruby/object:Gem::Version
109
- version: 2.13.0
82
+ version: '0'
110
83
  - !ruby/object:Gem::Dependency
111
- name: rdoc
84
+ name: rspec
112
85
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
86
  requirements:
115
87
  - - ~>
116
88
  - !ruby/object:Gem::Version
117
- version: '3.11'
89
+ version: '3.0'
118
90
  type: :development
119
91
  prerelease: false
120
92
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
93
  requirements:
123
94
  - - ~>
124
95
  - !ruby/object:Gem::Version
125
- version: '3.11'
96
+ version: '3.0'
126
97
  - !ruby/object:Gem::Dependency
127
98
  name: guard-rspec
128
99
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
- requirements:
131
- - - ~>
132
- - !ruby/object:Gem::Version
133
- version: 3.0.2
134
- type: :development
135
- prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
- requirements:
139
- - - ~>
140
- - !ruby/object:Gem::Version
141
- version: 3.0.2
142
- - !ruby/object:Gem::Dependency
143
- name: rb-fsevent
144
- requirement: !ruby/object:Gem::Requirement
145
- none: false
146
100
  requirements:
147
- - - ~>
101
+ - - ! '>='
148
102
  - !ruby/object:Gem::Version
149
- version: 0.9.3
103
+ version: '0'
150
104
  type: :development
151
105
  prerelease: false
152
106
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
107
  requirements:
155
- - - ~>
108
+ - - ! '>='
156
109
  - !ruby/object:Gem::Version
157
- version: 0.9.3
110
+ version: '0'
158
111
  description: A simple toolbox for build utilities that talk to Gmail with OAuth2
159
112
  email:
160
113
  - gallagher.paul@gmail.com
@@ -164,6 +117,8 @@ extensions: []
164
117
  extra_rdoc_files: []
165
118
  files:
166
119
  - .gitignore
120
+ - .rspec
121
+ - .travis.yml
167
122
  - Gemfile
168
123
  - Guardfile
169
124
  - LICENSE.txt
@@ -187,27 +142,26 @@ files:
187
142
  homepage: https://github.com/evendis/gmail_cli
188
143
  licenses:
189
144
  - MIT
145
+ metadata: {}
190
146
  post_install_message:
191
147
  rdoc_options: []
192
148
  require_paths:
193
149
  - lib
194
150
  required_ruby_version: !ruby/object:Gem::Requirement
195
- none: false
196
151
  requirements:
197
152
  - - ! '>='
198
153
  - !ruby/object:Gem::Version
199
154
  version: '0'
200
155
  required_rubygems_version: !ruby/object:Gem::Requirement
201
- none: false
202
156
  requirements:
203
157
  - - ! '>='
204
158
  - !ruby/object:Gem::Version
205
159
  version: '0'
206
160
  requirements: []
207
161
  rubyforge_project:
208
- rubygems_version: 1.8.25
162
+ rubygems_version: 2.4.5
209
163
  signing_key:
210
- specification_version: 3
164
+ specification_version: 4
211
165
  summary: GmailCli packages the key tools and adds a sprinkling of goodness to make
212
166
  it just that much easier to write primarily command-line utilities for Gmail/GoogleApps
213
167
  test_files: