sifttter-redux 0.4.7 → 0.4.8

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: 3f5212c6ef9ead91e8f71e3e2292f2e9aca80f29
4
- data.tar.gz: a49f77302bd648f7fcbd742c0d8be1687b373fae
3
+ metadata.gz: 60d6561700384dd389e9ad83674748fdf10e171f
4
+ data.tar.gz: 47a4a0bdb81fbb276f2840b4fdac80877ba80d5b
5
5
  SHA512:
6
- metadata.gz: 51a7a13606982a278551f2d2094ab16c459396987160b0a5fdd39697f334364842b044da24797c7a41c86fa345b8ca1918fe230f751b904d8e8f64ad5cf07d8f
7
- data.tar.gz: 3e5e4007131430433b69b902593f837f396f49c3c1fcd4f6f728145f8969ec4fe5aaff676089676463409ae2431d8d1696289707d72d2efd5675e08790cfdf25
6
+ metadata.gz: 62c99757888f32fcb3778352b316e7d7d0a3c62b1e41b3e8a1585d09082eed2d66a6af039afcfe67fd9ff155a52269c566f08f991ee9f33e47628fd57a9f2954
7
+ data.tar.gz: 8588bc94a220f4572a6d4c2cf2b675d2609ef117e0090d4348433ad967f32503cbc3d17af6b247892c92a2834f058f60ada09369e8df95a82fd3b76bc03c20b3
data/HISTORY.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.4.8 (2014-03-15)
2
+
3
+ * Fixed a bug in which Sifttter Redux would ignore log level specified in config file
4
+ * Made all prompt entry readline-based (for easier completion options)
5
+
1
6
  # 0.4.7 (2014-03-14)
2
7
 
3
8
  * Reworked logging to not require Methadone
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.7
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 (**tab completion works here!**)
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 (**tab completion works here!**)
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'])
@@ -70,7 +70,7 @@ module SifttterRedux
70
70
  else
71
71
  default = DBU_LOCAL_FILEPATH
72
72
  end
73
- path = CLIMessage::prompt_for_filepath('Location for Dropbox-Uploader', default)
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::prompt_for_filepath(prompt[:prompt], d)
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
- # prompt method
97
+ # log_level method
98
98
  #
99
- # Outputs a prompt, collects the user's response, and
100
- # returns it.
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
- def self.prompt(prompt, default = nil)
106
- print "# #{ prompt } #{ default.nil? ? '' : "[default: #{ default }]:" } ".green
107
- choice = $stdin.gets.chomp
108
- if choice.empty?
109
- r = default
110
- else
111
- r = choice
112
- end
113
- @@logger.debug("Answer to \"#{ prompt }\": #{ r }") unless @@logger.nil?
114
- r
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
- # prompt_for_filepath method
115
+ # prompt method
119
116
  #
120
117
  # Outputs a prompt, collects the user's response, and
121
- # returns it; adds in readline support for path
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.prompt_for_filepath(prompt, default = nil, start_dir = '')
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}*"]
@@ -1,4 +1,4 @@
1
1
  module SifttterRedux
2
- VERSION = '0.4.7'
2
+ VERSION = '0.4.8'
3
3
  NEWEST_CONFIG_VERSION = '0.4.7'
4
4
  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.4.7
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Bach