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 +4 -4
- data/HISTORY.md +4 -0
- data/README.md +3 -3
- data/Rakefile +1 -41
- data/bin/srd +6 -7
- data/lib/sifttter_redux/cli_message.rb +1 -1
- data/lib/sifttter_redux/configuration.rb +1 -1
- data/lib/sifttter_redux/version.rb +2 -2
- data/lib/sifttter_redux.rb +10 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac0c51854f8d85fe836c9bec7be780a4d149ef55
|
4
|
+
data.tar.gz: 83c7b28fe6fae8fae9c55d1e95c9b845a1fa5817
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 952c9d9cc4d4e68ced1d567278d4294fb5551ad7c5f9ff11f9fc4ba1a8ec847137dad74f29124ae45d3d3bf6db51cf13e6a6ceb6857f96d49a3e02b6b2895b3f
|
7
|
+
data.tar.gz: 3f8c244c3a6872727f775a2973ecbadfdbb1ad46730cae3f05f742bab981b0f6835cd8af6dc641f86fee6447f3c599852700fae9b58f4f827491f3d6ef2c84ef
|
data/HISTORY.md
CHANGED
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.
|
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")
|
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
|
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
|
-
|
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
|
177
|
-
|
178
|
-
SifttterRedux::init(true) if CLIMessage::prompt(long_message, 'N').downcase == 'y'
|
175
|
+
if options[:s]
|
176
|
+
SifttterRedux::init(true)
|
179
177
|
else
|
180
|
-
|
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 }
|
133
|
+
choice = Readline.readline("# #{ prompt }#{ default.nil? ? ':' : " [default: #{ default }]:" } ".green)
|
134
134
|
if choice.empty?
|
135
135
|
r = default
|
136
136
|
else
|
@@ -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.
|
5
|
-
NEWEST_CONFIG_VERSION = '0.5.
|
4
|
+
VERSION = '0.5.4'
|
5
|
+
NEWEST_CONFIG_VERSION = '0.5.4'
|
6
6
|
end
|
data/lib/sifttter_redux.rb
CHANGED
@@ -59,13 +59,13 @@ module SifttterRedux
|
|
59
59
|
# local filesystem.
|
60
60
|
# @return Void
|
61
61
|
# ----------------------------------------------------
|
62
|
-
def self.dbu_install_wizard(
|
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
|
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
|
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(
|
162
|
-
|
161
|
+
def self.init(init_from_scratch = false)
|
162
|
+
if init_from_scratch
|
163
163
|
Configuration::reset
|
164
|
-
Configuration::add_section(
|
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(
|
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 =
|
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
|
-
|
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
|