Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

rename setting param to profile

  • Loading branch information...
commit 0a21d4461482e2f104fa6c5aff5439a5069bd319 1 parent 140c1e2
@Laboratory authored
View
2  .gitignore
@@ -1,4 +1,4 @@
.idea/
Simple-watcher.iml
public/
-.settings
+.profile
View
6 README.md
@@ -18,6 +18,6 @@ Run simple-watcher command with parameters in console
## Params
simple-watcher [--without_js_compiling]
- [--watch_folder=folder]
- [--build_folder=folder]
- [--settings_name=file_name]
+ [--watch_folder=folder] - src by default
+ [--build_folder=folder] - public by default
+ [--profile_name=file_name] - .profile by default
View
3  run_watcher.sh
@@ -1,3 +1,4 @@
#!bin/bash
-simple-watcher --watch_folder=src --build_folder=public --settings_name=.settings --without_js_compiling
+simple-watcher --watch_folder=src --build_folder=public --profile_name=.profile --without_js_compiling
+# or simple-watcher
View
5 run_watcher_with_minification.sh
@@ -1,3 +1,6 @@
#!bin/bash
-simple-watcher --watch_folder=src --build_folder=public --settings_name=.settings
+# simple-watcher
+# simple-watcher --profile_name=.profile_name
+simple-watcher --watch_folder=src --build_folder=public --profile_name=.profile
+
View
8 simple-watcher.rb
@@ -15,11 +15,11 @@
watch_folder = "src"
build_folder = "public"
-setting_name = ".settings"
+profile_name = ".profile"
hash = {}
without_js_compiling = (argv_str.match(/--without_js_compiling/) != nil)
-["build_folder", "watch_folder", "setting_name"].each do |match_name|
+["build_folder", "watch_folder", "profile_name"].each do |match_name|
match = argv_str.match(Regexp.new('(--' + match_name + '=)([.\w\/]+)'))
unless (match.nil?)
eval("#{match_name}=\"#{match[2]}\"")
@@ -53,7 +53,7 @@ def console_log(text)
puts "<<< [#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}]\e[1m\e[32m #{text} \e[0m"
end
-File.open(setting_name, File::CREAT|File::RDWR) do |f|
+File.open(profile_name, File::CREAT|File::RDWR) do |f|
content = f.read
hash = eval(content) unless content.empty?
end
@@ -138,7 +138,7 @@ def console_log(text)
hash = new_hash
- File.open(setting_name, File::CREAT|File::RDWR) do |f|
+ File.open(profile_name, File::CREAT|File::RDWR) do |f|
f.truncate(0)
f.write(hash.to_s)
end
Please sign in to comment.
Something went wrong with that request. Please try again.