sifttter-redux 0.4.7 → 0.4.8
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 +5 -0
- data/README.md +17 -4
- data/bin/srd +1 -0
- data/lib/sifttter_redux.rb +2 -2
- data/lib/sifttter_redux/cli_message.rb +16 -25
- data/lib/sifttter_redux/version.rb +1 -1
- 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: 60d6561700384dd389e9ad83674748fdf10e171f
|
4
|
+
data.tar.gz: 47a4a0bdb81fbb276f2840b4fdac80877ba80d5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62c99757888f32fcb3778352b316e7d7d0a3c62b1e41b3e8a1585d09082eed2d66a6af039afcfe67fd9ff155a52269c566f08f991ee9f33e47628fd57a9f2954
|
7
|
+
data.tar.gz: 8588bc94a220f4572a6d4c2cf2b675d2609ef117e0090d4348433ad967f32503cbc3d17af6b247892c92a2834f058f60ada09369e8df95a82fd3b76bc03c20b3
|
data/HISTORY.md
CHANGED
data/README.md
CHANGED
@@ -37,7 +37,7 @@ SYNOPSIS
|
|
37
37
|
srd [global options] command [command options] [arguments...]
|
38
38
|
|
39
39
|
VERSION
|
40
|
-
0.4.
|
40
|
+
0.4.8
|
41
41
|
|
42
42
|
GLOBAL OPTIONS
|
43
43
|
--help - Show this message
|
@@ -81,10 +81,10 @@ Initialization will perform the following steps:
|
|
81
81
|
|
82
82
|
1. Download [Dropbox Uploader](https://github.com/andreafabrizi/Dropbox-Uploader "Dropbox-Uploder") to a location of your choice.
|
83
83
|
2. Automatically configure Dropbox Uploader.
|
84
|
-
3. Collect some user paths:
|
85
|
-
* The location on your filesystem where Sifttter files will be temporarily stored
|
84
|
+
3. Collect some user paths (note that you can use tab completion here!):
|
85
|
+
* The location on your filesystem where Sifttter files will be temporarily stored
|
86
86
|
* The location of your Sifttter files in Dropbox
|
87
|
-
* The location on your filesystem where Day One files will be temporarily stored
|
87
|
+
* The location on your filesystem where Day One files will be temporarily stored
|
88
88
|
* The location of your Day One files in Dropbox
|
89
89
|
|
90
90
|
## Pathing
|
@@ -410,6 +410,19 @@ Another option is to install the bundled gems to the global gemset:
|
|
410
410
|
$ bundle install --global
|
411
411
|
```
|
412
412
|
|
413
|
+
# Logging
|
414
|
+
|
415
|
+
Sifttter Redux logs a lot of good info to `~/.sifttter_redux_log`. It makes use of Ruby's standard log levels:
|
416
|
+
|
417
|
+
* DEBUG
|
418
|
+
* INFO
|
419
|
+
* WARN
|
420
|
+
* ERROR
|
421
|
+
* FATAL
|
422
|
+
* UNKNOWN
|
423
|
+
|
424
|
+
If you want to see more or less in your log files, simply change the `log_level` value in `~/.sifttter_redux` to your desired level.
|
425
|
+
|
413
426
|
# Known Issues & Future Releases
|
414
427
|
|
415
428
|
Bugs, issues, and enhancement requests (my own or those submitted by others) can be found on the [Issues Page](https://github.com/bachya/Sifttter-Redux/issues "Open Items").
|
data/bin/srd
CHANGED
@@ -65,6 +65,7 @@ pre do |global, command, options, args|
|
|
65
65
|
|
66
66
|
# Set up logging.
|
67
67
|
CLIMessage::activate_logging
|
68
|
+
CLIMessage::log_level(Configuration['sifttter_redux']['log_level'])
|
68
69
|
|
69
70
|
if File.exists?(SRD_CONFIG_FILEPATH)
|
70
71
|
current_version = Gem::Version.new(Configuration['sifttter_redux']['version'])
|
data/lib/sifttter_redux.rb
CHANGED
@@ -70,7 +70,7 @@ module SifttterRedux
|
|
70
70
|
else
|
71
71
|
default = DBU_LOCAL_FILEPATH
|
72
72
|
end
|
73
|
-
path = CLIMessage::
|
73
|
+
path = CLIMessage::prompt('Location for Dropbox-Uploader', default)
|
74
74
|
path = default if path.empty?
|
75
75
|
path.chop! if path.end_with?('/')
|
76
76
|
|
@@ -199,7 +199,7 @@ module SifttterRedux
|
|
199
199
|
|
200
200
|
pref_prompts.each do |prompt|
|
201
201
|
d = reinit ? Configuration[prompt[:section]][prompt[:key]] : prompt[:default]
|
202
|
-
pref = CLIMessage::
|
202
|
+
pref = CLIMessage::prompt(prompt[:prompt], d)
|
203
203
|
|
204
204
|
Configuration[prompt[:section]].merge!(prompt[:key] => File.expand_path(pref))
|
205
205
|
CLIMessage::debug("Value for #{ prompt[:key] }: #{ pref }")
|
@@ -94,42 +94,33 @@ module SifttterRedux
|
|
94
94
|
end
|
95
95
|
|
96
96
|
# ----------------------------------------------------
|
97
|
-
#
|
97
|
+
# log_level method
|
98
98
|
#
|
99
|
-
#
|
100
|
-
#
|
101
|
-
# @param prompt The prompt to output
|
102
|
-
# @param default The default option
|
103
|
-
# @return String
|
99
|
+
# Creates a simple logger to use
|
100
|
+
# @return Void
|
104
101
|
# ----------------------------------------------------
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
102
|
+
LOG_LEVELS = {
|
103
|
+
'DEBUG' => Logger::DEBUG,
|
104
|
+
'INFO' => Logger::INFO,
|
105
|
+
'WARN' => Logger::WARN,
|
106
|
+
'ERROR' => Logger::ERROR,
|
107
|
+
'FATAL' => Logger::FATAL,
|
108
|
+
'UNKNOWN' => Logger::UNKNOWN
|
109
|
+
}
|
110
|
+
def self.log_level(level)
|
111
|
+
@@logger.level = LOG_LEVELS[level] if LOG_LEVELS.key?(level)
|
115
112
|
end
|
116
113
|
|
117
114
|
# ----------------------------------------------------
|
118
|
-
#
|
115
|
+
# prompt method
|
119
116
|
#
|
120
117
|
# Outputs a prompt, collects the user's response, and
|
121
|
-
# returns it
|
122
|
-
# completion.
|
123
|
-
#
|
124
|
-
# "ruby readline filename tab completion" - William Morgan
|
125
|
-
# http://masanjin.net/blog/ruby-readline-tab-completion
|
126
|
-
#
|
118
|
+
# returns it.
|
127
119
|
# @param prompt The prompt to output
|
128
120
|
# @param default The default option
|
129
|
-
# @param start_dir The directory in which to start
|
130
121
|
# @return String
|
131
122
|
# ----------------------------------------------------
|
132
|
-
def self.
|
123
|
+
def self.prompt(prompt, default = nil, start_dir = '')
|
133
124
|
Readline.completion_append_character = nil
|
134
125
|
Readline.completion_proc = lambda do |prefix|
|
135
126
|
files = Dir["#{start_dir}#{prefix}*"]
|