lionel_richie 0.2.0 → 0.2.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,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NGIyMjk4ZjAwYjc0ZTFhZjU3ZGY1NWY3ZWE5OTcxM2QzZmVlYjIwZg==
5
- data.tar.gz: !binary |-
6
- Mjk0YTljYjNkZDVlNDZlMTMzYTc3MWMyMWE4Nzc4MjNkOGJhOTk0Mg==
2
+ SHA1:
3
+ metadata.gz: 00862f0ac0556f2fec0c350f0e594736a496a357
4
+ data.tar.gz: bfdc343a1736db741d4b4915c481ea6250401f2b
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MTg3NmM5ZDMyM2FhOWExNjYxNjEwODY1ZWQzMDQzNDA0ZWQxMzA1Y2M3MWE5
10
- MzMyYzUyYWE0YTFmNGY3MDQyZGE5ZmQyNTZlMjYzZmNjM2JhYjQ4ZWEyM2U4
11
- NWMwNDU2MmVlYzQ1OWVkMTczNzY5NjBiYjIwODE0NTUwZDA3NTE=
12
- data.tar.gz: !binary |-
13
- ZWNlMDk4YWQyOTZjZTQ1ODc1NzU0YTA4NjBhMDNhYTRjZmYxMjc3MmEzMjMw
14
- ODRjYWE0MjJiMTEwZWQzNjI2MTk1YTM2MzQwNzk5MDM1YTY0YWU3YjgwZTU0
15
- NzQ0MzlmNWE4YTc0MDhkZTE2MzkyNmRhMDdkN2FhODBmNTMxNzM=
6
+ metadata.gz: 75119c5706e4566227d3e7f989815561981e3a6b2b4a3f8c5d8cc0907f9b94e211d4ca7dfb6270f86e655eaed9b38fd6805fe79edd57dd339e50a5132c82ceb5
7
+ data.tar.gz: c8aa37a22b972d01c4a10895e95432988d8b8fa4efba8cdc3b0f827f7a517104fc37334855a4c1b8b06db93fcb6274eb4895091858c7e3df29256cdaf2ac7868
data/.gitignore CHANGED
@@ -19,3 +19,7 @@ tmp
19
19
  .ruby-version
20
20
  .versions.conf
21
21
  Lionelfile
22
+ Guardfile
23
+
24
+ Lionelfile.*
25
+ script/*.local
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ 0.2.1 - October 1, 2015
4
+
5
+ * Better authentication error handling
6
+ * Method for counting items in checklist
3
7
 
4
8
  0.2.0 - January 8, 2014
5
9
 
data/Gemfile CHANGED
@@ -6,5 +6,5 @@ gemspec
6
6
 
7
7
  group :development do
8
8
  gem 'pry'
9
- gem 'pry-debugger'
9
+ gem 'pry-byebug'
10
10
  end
data/README.md CHANGED
@@ -4,9 +4,7 @@
4
4
 
5
5
  LionelRichie is a script for exporting Trello data to Google Docs.
6
6
 
7
- This gem is in its very early stages so its probably not useful to you yet.
8
-
9
- ![Trello? Is it me you're looking for?](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRmSbZ56riC_raK-rR4HiV4YKjvXTTUQy4_GCpPAYqdSkCz3RhO)
7
+ ![Trello? Is it me you're looking for?](http://cdn.memegenerator.net/instances/500x/19904714.jpg)
10
8
 
11
9
  ## Installation
12
10
 
data/lib/lionel/cli.rb CHANGED
@@ -77,6 +77,9 @@ module Lionel
77
77
  end
78
78
  rescue Trello::Error, Trello::InvalidAccessToken
79
79
  invoke :authorize, ['trello'], {}
80
+ ensure
81
+ export = Lionel::Export.new(options)
82
+ export.authenticate
80
83
  end
81
84
 
82
85
  welcome = "Trello? Is it me you're looking for?"
@@ -18,24 +18,24 @@ module Lionel
18
18
 
19
19
  def retrieve_access_token(authorization_code)
20
20
  @access_token = client.auth_code.get_token(authorization_code,
21
- :redirect_uri => "urn:ietf:wg:oauth:2.0:oob")
21
+ :redirect_uri => "urn:ietf:wg:oauth:2.0:oob")
22
22
  end
23
23
 
24
24
  def refresh
25
25
  return false unless refresh_token
26
26
 
27
27
  current_token = OAuth2::AccessToken.from_hash(client,
28
- {:refresh_token => refresh_token, :expires_at => 604800}) # 1 week
28
+ :refresh_token => refresh_token,
29
+ :expires_in => one_year
30
+ )
29
31
  @access_token = current_token.refresh! # returns new access_token
30
32
  end
31
33
 
32
34
  def authorize_url
33
35
  client.auth_code.authorize_url(
34
36
  :redirect_uri => "urn:ietf:wg:oauth:2.0:oob",
35
- :scope =>
36
- "https://docs.google.com/feeds/ " +
37
- "https://docs.googleusercontent.com/ " +
38
- "https://spreadsheets.google.com/feeds/")
37
+ :scope => scopes.join(' ')
38
+ )
39
39
  end
40
40
 
41
41
  def api_console_url
@@ -44,9 +44,9 @@ module Lionel
44
44
 
45
45
  def client
46
46
  @client ||= OAuth2::Client.new(google_client_id, google_client_secret,
47
- :site => "https://accounts.google.com",
48
- :token_url => "/o/oauth2/token",
49
- :authorize_url => "/o/oauth2/auth")
47
+ :site => "https://accounts.google.com",
48
+ :token_url => "/o/oauth2/token",
49
+ :authorize_url => "/o/oauth2/auth")
50
50
  end
51
51
 
52
52
  private
@@ -55,5 +55,17 @@ module Lionel
55
55
  @refresh_token || configuration.google_refresh_token
56
56
  end
57
57
 
58
+ def scopes
59
+ [
60
+ "https://docs.google.com/feeds/",
61
+ "https://docs.googleusercontent.com/",
62
+ "https://spreadsheets.google.com/feeds/"
63
+ ]
64
+ end
65
+
66
+ def one_year # in seconds
67
+ 31557600
68
+ end
69
+
58
70
  end
59
71
  end
@@ -63,5 +63,11 @@ module Lionel
63
63
  format_date(due) if due
64
64
  end
65
65
 
66
+ def checklist_count(name)
67
+ checklist = card.checklists.find { |chl| chl.name == name }
68
+ return 0 unless checklist
69
+ checklist.check_items.count
70
+ end
71
+
66
72
  end
67
73
  end
@@ -1,3 +1,3 @@
1
1
  module Lionel
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,139 +1,139 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lionel_richie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ross Kaffenberger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-08 00:00:00.000000000 Z
11
+ date: 2015-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-trello
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: google_drive
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: yajl-ruby
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: thor
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: faraday
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0.8'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0.8'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: launchy
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: bundler
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: '1.3'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.3'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ! '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ! '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: guard-rspec
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ! '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ! '>='
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  description: Export Trello to Google Docs
@@ -144,8 +144,8 @@ executables:
144
144
  extensions: []
145
145
  extra_rdoc_files: []
146
146
  files:
147
- - .gitignore
148
- - .rspec
147
+ - ".gitignore"
148
+ - ".rspec"
149
149
  - CHANGELOG.md
150
150
  - Gemfile
151
151
  - Guardfile
@@ -185,17 +185,17 @@ require_paths:
185
185
  - lib
186
186
  required_ruby_version: !ruby/object:Gem::Requirement
187
187
  requirements:
188
- - - ! '>='
188
+ - - ">="
189
189
  - !ruby/object:Gem::Version
190
190
  version: '0'
191
191
  required_rubygems_version: !ruby/object:Gem::Requirement
192
192
  requirements:
193
- - - ! '>='
193
+ - - ">="
194
194
  - !ruby/object:Gem::Version
195
195
  version: '0'
196
196
  requirements: []
197
197
  rubyforge_project:
198
- rubygems_version: 2.1.11
198
+ rubygems_version: 2.2.2
199
199
  signing_key:
200
200
  specification_version: 4
201
201
  summary: Export Trello to Google Docs
@@ -206,3 +206,4 @@ test_files:
206
206
  - spec/lib/lionel/trello_authentication_spec.rb
207
207
  - spec/lib/lionel_spec.rb
208
208
  - spec/spec_helper.rb
209
+ has_rdoc: