reup 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/reup +27 -4
- data/lib/reup.rb +13 -0
- data/lib/reup/{env.yaml → .reup.yaml} +1 -0
- data/lib/reup/helpers.rb +9 -2
- data/lib/reup/user_settings.rb +7 -0
- data/lib/reup/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90325825af95f75e1a566aae5e5b032147489a35
|
4
|
+
data.tar.gz: a189400ae9b62bc9aa6ac102737621727f256742
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3521ac2266e80578b8623ebdc50868063e755d331fd198711f0dd9db5c231722199c20efbdff7d42bcc96c5b3d3e48b18bf63c0325d24f6d032f8e1b8f787b94
|
7
|
+
data.tar.gz: ae196a78a7cc899c8c710423df930d9ba692db5642ad8d22d4a93929afacdcc9eb67d73772fa2e54c8daca42da0a226d5e15d8f36c1518057caa1c5eebae9f3f
|
data/bin/reup
CHANGED
@@ -1,22 +1,45 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
2
|
|
3
|
+
require_relative "../lib/reup"
|
3
4
|
require "slop"
|
4
5
|
require "cocaine"
|
5
6
|
|
6
|
-
|
7
|
-
require_relative "../lib/reup/helpers"
|
8
|
-
|
9
|
-
include Reup::Helpers
|
7
|
+
include Reup
|
10
8
|
|
11
9
|
options = Slop.parse do |option|
|
12
10
|
option.bool "-r", "--resetdb", "resets the database"
|
13
11
|
option.string "-b", "--branch", "checkout branch"
|
12
|
+
option.bool "-f", "--force", "force an action"
|
13
|
+
option.bool "-i", "--init", "initialize local settings file to #{USER_SETTINGS_PATH}"
|
14
|
+
option.bool "-h", "--help", "print this dialog"
|
14
15
|
option.on "-v", "--version", "print the version" do
|
15
16
|
puts Reup::VERSION
|
16
17
|
exit
|
17
18
|
end
|
18
19
|
end
|
19
20
|
|
21
|
+
if options.help?
|
22
|
+
puts options
|
23
|
+
exit
|
24
|
+
end
|
25
|
+
|
26
|
+
if options.init?
|
27
|
+
puts "Initializing user settings file..."
|
28
|
+
if File.exist? USER_SETTINGS_PATH
|
29
|
+
if options.force?
|
30
|
+
puts "Overwriting existing settings file..."
|
31
|
+
FileUtils.rm USER_SETTINGS_PATH
|
32
|
+
else
|
33
|
+
puts "The file #{USER_SETTINGS_PATH} already exists. Use --force to override."
|
34
|
+
exit
|
35
|
+
end
|
36
|
+
end
|
37
|
+
initialize_user_settings
|
38
|
+
puts "Local settings file initialized to #{USER_SETTINGS_PATH}"
|
39
|
+
exit
|
40
|
+
end
|
41
|
+
|
42
|
+
|
20
43
|
wasChange = detect_change_to(watch_files) do
|
21
44
|
run "git checkout #{options[:branch]}", quiet: true if options.branch?
|
22
45
|
run "git pull"
|
data/lib/reup.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
require_relative "reup/helpers"
|
2
|
+
require_relative "reup/version"
|
3
|
+
require_relative "reup/user_settings"
|
4
|
+
require "fileutils"
|
5
|
+
|
6
|
+
module Reup
|
7
|
+
DEFAULT_SETTINGS_PATH = File.expand_path "../reup/.reup.yaml", __FILE__
|
8
|
+
USER_SETTINGS_PATH = File.expand_path ".reup.yaml", Dir.home
|
9
|
+
end
|
10
|
+
|
11
|
+
include Reup
|
12
|
+
include Reup::Helpers
|
13
|
+
include Reup::UserSettings
|
data/lib/reup/helpers.rb
CHANGED
@@ -3,7 +3,8 @@ require "yaml"
|
|
3
3
|
module Reup
|
4
4
|
module Helpers
|
5
5
|
|
6
|
-
|
6
|
+
DEFAULT_ENV_FILE = File.expand_path "../.reup.yaml", __FILE__
|
7
|
+
USER_ENV_FILE = File.expand_path ".reup.yaml", Dir.home
|
7
8
|
|
8
9
|
###########################################################################
|
9
10
|
# Executable helpers
|
@@ -48,7 +49,13 @@ module Reup
|
|
48
49
|
end
|
49
50
|
|
50
51
|
def env_file
|
51
|
-
@env_file ||=
|
52
|
+
@env_file ||= (
|
53
|
+
if File.exist? USER_ENV_FILE
|
54
|
+
YAML.load_file USER_ENV_FILE
|
55
|
+
else
|
56
|
+
YAML.load_file DEFAULT_ENV_FILE
|
57
|
+
end
|
58
|
+
)
|
52
59
|
end
|
53
60
|
|
54
61
|
def watch_files
|
data/lib/reup/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Toniazzo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocaine
|
@@ -113,8 +113,9 @@ files:
|
|
113
113
|
- bin/reup
|
114
114
|
- bin/setup
|
115
115
|
- lib/reup.rb
|
116
|
-
- lib/reup
|
116
|
+
- lib/reup/.reup.yaml
|
117
117
|
- lib/reup/helpers.rb
|
118
|
+
- lib/reup/user_settings.rb
|
118
119
|
- lib/reup/version.rb
|
119
120
|
- reup.gemspec
|
120
121
|
homepage: https://github.com/jutonz/reup
|