pinpress 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 271e0acf9b01155f4eb894e840347967bb5795c7
4
- data.tar.gz: eb6f48a7cdc0f339fd1dea648daeebd9dacb6588
3
+ metadata.gz: 967966057972d861227970f7e880f192f32b2073
4
+ data.tar.gz: c4eb878fab8f404aedee8d3690536e4f96f7ef0c
5
5
  SHA512:
6
- metadata.gz: 8c92541fd0e817f807199cc9a9de82bb32bb52e7943905e2747b58ca99b5c42d6054e810e04a2a0350336d8795fb13e5efd56c73967f5e4385fa3fe39310aa90
7
- data.tar.gz: e2241935876943ce235bc5e608560ea506e4a0084568dc7896acb9e67582edb2001e0e242010e1ad8165821b9dee2b591528ddd8f293692fb3fd5face023828a
6
+ metadata.gz: fa530a3468b14d2027ebb9ff364f2b44b13042aa38e09ce4f10c2f8ee4f718037f3f9b230a34addb7012f68edca32093eee3bcec3b26dc090dc9c48b19a32c80
7
+ data.tar.gz: ad316385a8979de586cfe8c8a06fb2c7b6df621ed25aaa460593e33051edd895355c638ec3b15d102e5df3aae93e6142b82d639f67831961abd1527a37e76cbc
data/HISTORY.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.4.1 (2014-05-13)
2
+
3
+ * Fixed a bug with displaying templates
4
+
1
5
  # 1.4.0 (2014-05-13)
2
6
 
3
7
  * Modified last_run logic to exist on each template
data/README.md CHANGED
@@ -42,7 +42,7 @@ SYNOPSIS
42
42
  pinpress [global options] command [command options] [arguments...]
43
43
 
44
44
  VERSION
45
- 1.4.0
45
+ 1.4.1
46
46
 
47
47
  GLOBAL OPTIONS
48
48
  --help - Show this message
@@ -69,6 +69,7 @@ SYNOPSIS
69
69
 
70
70
  COMMAND OPTIONS
71
71
  -e arg - The end date to pull pins to (default: none)
72
+ -m arg - The pin template to use (default: none)
72
73
  -n arg - The number of results to return (default: none)
73
74
  -s arg - The start date to pull pins from (default: none)
74
75
  -t arg - The tags to use (e.g., "ruby,pinboard") (default: none)
@@ -421,7 +422,7 @@ pinpress:
421
422
  default_tags: ['link-mash']
422
423
  ignored_tags: ['buffer']
423
424
  log_level: WARN
424
- version: 1.1.1
425
+ version: 1.4.0
425
426
  api_token: bachya:1234567890987654321
426
427
  pin_templates:
427
428
  pinpress_default
data/bin/pinpress CHANGED
@@ -155,7 +155,7 @@ command :pins do |c|
155
155
  puts output if output
156
156
 
157
157
  # Save the last-run date to the configuration file.
158
- configuration.pin_templates[template_name.to_sym].last_run = Time.now.utc.iso8601
158
+ configuration.pin_templates.find { |t| t.keys[0] == template_name.to_sym}.values[0].last_run = Time.now.utc.iso8601
159
159
  configuration.save
160
160
  end
161
161
 
@@ -168,7 +168,7 @@ command :pins do |c|
168
168
  # and/or the presence of a default template.
169
169
  template_name, template = PinPress.init_template(options[:m], PinPress::Template::TYPE_PIN)
170
170
 
171
- last_run_date = configuration.pin_templates[template_name.to_sym].last_run
171
+ last_run_date = configuration.pin_templates.find { |t| t.keys[0] == template_name.to_sym }.values[0].last_run
172
172
  if last_run_date
173
173
  # Set one option: the start date. Set it to the last-run date + 1.
174
174
  opts = {}
@@ -180,8 +180,8 @@ command :pins do |c|
180
180
  puts output if output
181
181
 
182
182
  # Save the last-run date to the configuration file.
183
- configuration.pin_templates[template_name.to_sym].last_run = Time.now.utc.iso8601
184
- configuration.save
183
+ configuration.pin_templates.find { |t| t.keys[0] == template_name.to_sym}.values[0].last_run = Time.now.utc.iso8601
184
+ configuration.save
185
185
  else
186
186
  messenger.warn("`pinpress pins` hasn't been run before.")
187
187
  end
@@ -221,7 +221,8 @@ command :tags do |c|
221
221
  puts output if output
222
222
 
223
223
  # Save the last-run date to the configuration file.
224
- configuration.tag_templates[template_name.to_sym].last_run = Time.now.utc.iso8601
224
+ t_config = configuration.tag_templates.find { |t| t.keys[0] == template_name.to_sym}.values[0]
225
+ t_config.last_run = Time.now.utc.iso8601
225
226
  configuration.save
226
227
  end
227
228
 
@@ -232,7 +233,7 @@ command :tags do |c|
232
233
  # and/or the presence of a default template.
233
234
  template_name, template = PinPress.init_template(options[:m], PinPress::Template::TYPE_TAG)
234
235
 
235
- last_run_date = configuration.tag_templates[template_name.to_sym].last_run
236
+ last_run_date = configuration.tag_templates.find { |t| t.keys[0] == template_name.to_sym }.values[0].last_run
236
237
  if last_run_date
237
238
  PinPress.verbose = global_options[:v]
238
239
 
@@ -246,7 +247,8 @@ command :tags do |c|
246
247
  puts output if output
247
248
 
248
249
  # Save the last-run date to the configuration file.
249
- configuration.tag_templates[template_name.to_sym].last_run = Time.now.utc.iso8601
250
+ t_config = configuration.tag_templates.find { |t| t.keys[0] == template_name.to_sym}.values[0]
251
+ t_config.last_run = Time.now.utc.iso8601
250
252
  configuration.save
251
253
  else
252
254
  messenger.warn("`pinpress tags` hasn't been run before.")
@@ -28,5 +28,5 @@ module PinPress
28
28
  SUMMARY = 'A simple CLI to create HTML templates of Pinboard data.'
29
29
 
30
30
  # The Gem's version
31
- VERSION = '1.4.0'
31
+ VERSION = '1.4.1'
32
32
  end
data/lib/pinpress.rb CHANGED
@@ -45,9 +45,9 @@ module PinPress
45
45
  def get_template(template_name, template_type)
46
46
  case template_type
47
47
  when PinPress::Template::TYPE_PIN
48
- configuration.pin_templates[template_name.to_sym]
48
+ configuration.pin_templates.find { |t| t.keys[0] == template_name.to_sym}.values[0]
49
49
  when PinPress::Template::TYPE_TAG
50
- configuration.tag_templates[template_name.to_sym]
50
+ configuration.tag_templates.find { |t| t.keys[0] == template_name.to_sym}.values[0]
51
51
  end
52
52
  end
53
53
 
@@ -132,7 +132,7 @@ module PinPress
132
132
  when PinPress::Template::TYPE_TAG
133
133
  templates = configuration.tag_templates
134
134
  end
135
- !templates[template_name.to_sym].nil?
135
+ !templates.find { |t| t.keys[0] == template_name.to_sym }.nil?
136
136
  end
137
137
 
138
138
  # Present a list of installed templates to the user
@@ -143,8 +143,10 @@ module PinPress
143
143
 
144
144
  messenger.section('AVAILABLE PIN TEMPLATES:')
145
145
  if pin_templates
146
+ # pin_templates.each_with_index do |template, index|
146
147
  pin_templates.each_with_index do |template, index|
147
- puts "#{ index + 1 }.\tName: ".blue + "#{ template[:name] }"
148
+ template_name, template = template.first
149
+ puts "#{ index + 1 }.\tName: ".blue + "#{ template_name }"
148
150
  puts "Opener:".blue.rjust(22) + "\t#{ template[:opener] }".truncate(80)
149
151
  puts "Item:".blue.rjust(22) + "\t#{ template[:item] }".truncate(80)
150
152
  puts "Closer:".blue.rjust(22) + "\t#{ template[:closer] }".truncate(80)
@@ -156,7 +158,8 @@ module PinPress
156
158
  messenger.section('AVAILABLE TAG TEMPLATES:')
157
159
  if tag_templates
158
160
  tag_templates.each_with_index do |template, index|
159
- puts "#{ index + 1 }.\tName: ".blue + "#{ template[:name] }"
161
+ template_name, template = template.first
162
+ puts "#{ index + 1 }.\tName: ".blue + "#{ template_name }"
160
163
  puts "Opener:".blue.rjust(22) + "\t#{ template[:opener] }".truncate(80)
161
164
  puts "Item:".blue.rjust(22) + "\t#{ template[:item] }".truncate(80)
162
165
  puts "Closer:".blue.rjust(22) + "\t#{ template[:closer] }".truncate(80)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pinpress
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Bach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-13 00:00:00.000000000 Z
11
+ date: 2014-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aruba