sifttter-redux 0.5.3 → 0.5.4

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e19b289fe78eeb98bf8d7690e232251277e6911
4
- data.tar.gz: 00a579af73904367f8c8f842301104c05a209a31
3
+ metadata.gz: ac0c51854f8d85fe836c9bec7be780a4d149ef55
4
+ data.tar.gz: 83c7b28fe6fae8fae9c55d1e95c9b845a1fa5817
5
5
  SHA512:
6
- metadata.gz: 79470d813b0eaa664823049b2a7bff6f3ef63b81970c04a4d28d4ae375faf6c1b087cb7e36ecf3372d75a7cc8f74fe3cad365777f3d1b03155c416c0af3b239d
7
- data.tar.gz: fe6c117183db7faabbe057c5a46c3cc7cf2830d95d7142db7eb03be2ec80356722d4c053af1bd5acd10c5a339e77be559825272c01030da69390e9642fc03b1b
6
+ metadata.gz: 952c9d9cc4d4e68ced1d567278d4294fb5551ad7c5f9ff11f9fc4ba1a8ec847137dad74f29124ae45d3d3bf6db51cf13e6a6ceb6857f96d49a3e02b6b2895b3f
7
+ data.tar.gz: 3f8c244c3a6872727f775a2973ecbadfdbb1ad46730cae3f05f742bab981b0f6835cd8af6dc641f86fee6447f3c599852700fae9b58f4f827491f3d6ef2c84ef
data/HISTORY.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.5.4 (2014-03-19)
2
+
3
+ * Fixed several bugs related to configuration management
4
+
1
5
  # 0.5.3 (2014-03-18)
2
6
 
3
7
  * Fixed regression with gemspec
data/README.md CHANGED
@@ -39,7 +39,7 @@ SYNOPSIS
39
39
  srd [global options] command [command options] [arguments...]
40
40
 
41
41
  VERSION
42
- 0.5.3
42
+ 0.5.4
43
43
 
44
44
  GLOBAL OPTIONS
45
45
  --help - Show this message
@@ -456,6 +456,6 @@ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
456
456
  # Credits
457
457
 
458
458
  * Craig Eley for [Sifttter](http://craigeley.com/post/72565974459/sifttter-an-ifttt-to-day-one-logger "Sifttter") and for giving me the idea for Sifttter Redux
459
- * Dave Copeland for [GLI](https://github.com/davetron5000/gli "GLI") and [Methadone]("https://github.com/davetron5000/methadone" Methadone)
459
+ * Dave Copeland for [GLI](https://github.com/davetron5000/gli "GLI")
460
460
  * Andrea Fabrizi for [Dropbox Uploader](https://github.com/andreafabrizi/Dropbox-Uploader "Dropbox Uploader")
461
- * Tom Preston-Werner and Lee Jarvis for [Chronic](https://github.com/mojombo/chronic "Chronic")
461
+ * ~~Tom Preston-Werner~~ (sorry: can't support [harrassment](http://www.businessinsider.com/github-co-founder-suspended-2014-3 "GitHub Founder Tom Preston-Werner Suspended After Harassment Allegations")) ~~and~~ Lee Jarvis for [Chronic](https://github.com/mojombo/chronic "Chronic")
data/Rakefile CHANGED
@@ -41,44 +41,4 @@ Rake::TestTask.new do |t|
41
41
  t.test_files = FileList['test/*_test.rb']
42
42
  end
43
43
 
44
- task :default => [:test,:features]
45
-
46
- # require 'rake/clean'
47
- # require 'rubygems'
48
- # require 'rubygems/package_task'
49
- # require 'cucumber'
50
- # require 'cucumber/rake/task'
51
- # spec = eval(File.read('sifttter_redux.gemspec'))
52
- #
53
- # Gem::PackageTask.new(spec) do |pkg|
54
- # end
55
- #
56
- # CUKE_RESULTS = 'results.html'
57
- # CLEAN << CUKE_RESULTS
58
- #
59
- # desc 'Run features'
60
- # Cucumber::Rake::Task.new(:features) do |t|
61
- # opts = "features --format html -o #{CUKE_RESULTS} --format progress -x"
62
- # opts += " --tags #{ENV['TAGS']}" if ENV['TAGS']
63
- # t.cucumber_opts = opts
64
- # t.fork = false
65
- # end
66
- #
67
- # desc 'Run features tagged as work-in-progress (@wip)'
68
- # Cucumber::Rake::Task.new('features:wip') do |t|
69
- # tag_opts = ' --tags ~@pending'
70
- # tag_opts = ' --tags @wip'
71
- # t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty -x -s#{tag_opts}"
72
- # t.fork = false
73
- # end
74
- #
75
- # task :cucumber => :features
76
- # task 'cucumber:wip' => 'features:wip'
77
- # task :wip => 'features:wip'
78
- # require 'rake/testtask'
79
- # Rake::TestTask.new do |t|
80
- # t.libs << "test"
81
- # t.test_files = FileList['test/*_test.rb']
82
- # end
83
- #
84
- # task :default => [:test,:features]
44
+ task :default => [:test]
data/bin/srd CHANGED
@@ -77,14 +77,13 @@ pre do |global, command, options, args|
77
77
  CLIMessage::info("Don't worry; when prompted, your current values for")
78
78
  CLIMessage::info("existing config options will be presented (so it'll")
79
79
  CLIMessage::info('be easier to fly through the upgrade).')
80
- CLIMessage::prompt('Press enter to continue: ')
80
+ CLIMessage::prompt('Press enter to continue')
81
81
  SifttterRedux::init(true)
82
82
  exit!(0)
83
83
  end
84
84
  else
85
85
  # Force the user to init if they try to run any command other than `init` first.
86
- CLIMessage::info('Initializing Sifttter Redux first...') unless command.name_for_help[0] == 'init'
87
- SifttterRedux::init
86
+ SifttterRedux::init(true)
88
87
  exit!(0)
89
88
  end
90
89
 
@@ -173,11 +172,11 @@ command :init do |c|
173
172
 
174
173
  c.action do |global_options, options, args|
175
174
  CLIMessage::section_block('INITIALIZING...') do
176
- if File.exists?(Configuration::config_path) && !options[:s]
177
- long_message = "You've already initialized Sifttter Redux. Do it again?"
178
- SifttterRedux::init(true) if CLIMessage::prompt(long_message, 'N').downcase == 'y'
175
+ if options[:s]
176
+ SifttterRedux::init(true)
179
177
  else
180
- SifttterRedux::init
178
+ long_message = "You've already initialized Sifttter Redux. Do it again?"
179
+ SifttterRedux::init if CLIMessage::prompt(long_message, 'N').downcase == 'y'
181
180
  end
182
181
  end
183
182
  end
@@ -130,7 +130,7 @@ module SifttterRedux
130
130
  map { |f| File.expand_path(f) }.
131
131
  map { |f| File.directory?(f) ? f + "/" : f }
132
132
  end
133
- choice = Readline.readline("# #{ prompt } #{ default.nil? ? '' : "[default: #{ default }]:" } ".green)
133
+ choice = Readline.readline("# #{ prompt }#{ default.nil? ? ':' : " [default: #{ default }]:" } ".green)
134
134
  if choice.empty?
135
135
  r = default
136
136
  else
@@ -29,7 +29,7 @@ module SifttterRedux
29
29
  end
30
30
 
31
31
  def method_missing(name, *args, &block)
32
- @_data[name.to_sym] || {}
32
+ @_data[name.to_sym] || @_data.merge!(name.to_sym => {})
33
33
  end
34
34
 
35
35
  def self.add_section(section_name)
@@ -1,6 +1,6 @@
1
1
  module SifttterRedux
2
2
  DESCRIPTION = 'A customized IFTTT-to-Day One service that allows for smart installation and automated running on a standalone *NIX device (such as a Raspberry Pi).'
3
3
  SUMMARY = 'Automated IFTTT to Day One engine.'
4
- VERSION = '0.5.3'
5
- NEWEST_CONFIG_VERSION = '0.5.3'
4
+ VERSION = '0.5.4'
5
+ NEWEST_CONFIG_VERSION = '0.5.4'
6
6
  end
@@ -59,13 +59,13 @@ module SifttterRedux
59
59
  # local filesystem.
60
60
  # @return Void
61
61
  # ----------------------------------------------------
62
- def self.dbu_install_wizard(reinit = false)
62
+ def self.dbu_install_wizard(init_from_scratch = false)
63
63
  valid_path_chosen = false
64
64
 
65
65
  CLIMessage::section_block('CONFIGURING DROPBOX UPLOADER...') do
66
66
  until valid_path_chosen
67
67
  # Prompt the user for a location to save Dropbox Uploader.
68
- if reinit && !Configuration::db_uploader[:base_filepath].nil?
68
+ if init_from_scratch && !Configuration::db_uploader[:base_filepath].nil?
69
69
  default = Configuration::db_uploader[:base_filepath]
70
70
  else
71
71
  default = DBU_LOCAL_FILEPATH
@@ -94,7 +94,7 @@ module SifttterRedux
94
94
  CLIMessage::info_block('Initializing Dropbox Uploader...') { system "#{ executable_path }" }
95
95
  end
96
96
 
97
- Configuration::add_section(:db_uploader) unless reinit
97
+ Configuration::add_section(:db_uploader) unless init_from_scratch
98
98
  Configuration::db_uploader.merge!({
99
99
  base_filepath: path,
100
100
  dbu_filepath: dbu_path,
@@ -158,10 +158,10 @@ module SifttterRedux
158
158
  # collecting all necessary items and info.
159
159
  # @return Void
160
160
  # ----------------------------------------------------
161
- def self.init(reinit = false)
162
- unless reinit
161
+ def self.init(init_from_scratch = false)
162
+ if init_from_scratch
163
163
  Configuration::reset
164
- Configuration::add_section('sifttter_redux')
164
+ Configuration::add_section(:sifttter_redux)
165
165
  end
166
166
 
167
167
  Configuration::sifttter_redux.merge!({
@@ -171,7 +171,7 @@ module SifttterRedux
171
171
  })
172
172
 
173
173
  # Run the wizard to download Dropbox Uploader.
174
- dbu_install_wizard(reinit = reinit)
174
+ dbu_install_wizard(init_from_scratch = init_from_scratch)
175
175
 
176
176
  # Collect other misc. preferences.
177
177
  CLIMessage::section_block('COLLECTING PREFERENCES...') do
@@ -203,11 +203,11 @@ module SifttterRedux
203
203
  ]
204
204
 
205
205
  pref_prompts.each do |prompt|
206
- d = reinit ? Configuration::send(prompt[:section].to_sym)[prompt[:key]] : prompt[:default]
206
+ d = init_from_scratch ? prompt[:default] : Configuration::send(prompt[:section])[prompt[:key]]
207
207
  pref = CLIMessage::prompt(prompt[:prompt], d)
208
-
209
208
  pref = File.expand_path(pref) if pref.start_with?('~')
210
- Configuration::send(prompt[:section].to_sym).merge!(prompt[:key] => pref)
209
+
210
+ Configuration::send(prompt[:section]).merge!(prompt[:key] => pref)
211
211
  CLIMessage::debug("Value for #{ prompt[:key] }: #{ pref }")
212
212
  end
213
213
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sifttter-redux
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Bach