autovrsion 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -13
- data/autovrsion.gemspec +6 -5
- data/lib/autovrsion/filelistener.rb +18 -18
- data/lib/autovrsion/version.rb +1 -1
- metadata +44 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2052fee9c68fdc3f51d8e0fbe940769ecfc650b8
|
4
|
+
data.tar.gz: 783b2b647bb5b049624d6f389735694ed48b4e36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ce5709d4f80c322736a99d8723ff4e7711a48f3b7c337180b4d5434b13aa5ea138e071ad617a558a385d773651792da4871cb4b6a84b48cddfd9e1843056b16
|
7
|
+
data.tar.gz: 9eaf1c4c5c627eb87da3532584e7f44c3c9ebf2aae3a050d4de0a8b297d818de97c01effb7ce0229bb355e57a7ec1b00d7514139caf6e728d3d5311124484fc3
|
data/README.md
CHANGED
@@ -18,10 +18,15 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Pre-requisities
|
20
20
|
install Git:
|
21
|
+
|
21
22
|
command: $ sudo apt-get install git
|
23
|
+
|
22
24
|
install Ruby:
|
25
|
+
|
23
26
|
links for downloading and installing ruby
|
27
|
+
|
24
28
|
https://www.ruby-lang.org/en/downloads/
|
29
|
+
|
25
30
|
https://www.ruby-lang.org/en/installation/
|
26
31
|
|
27
32
|
## Usage
|
@@ -41,26 +46,27 @@ https://www.ruby-lang.org/en/installation/
|
|
41
46
|
|
42
47
|
### Command Usage
|
43
48
|
|
44
|
-
$ autovrsion create
|
45
|
-
|
46
|
-
|
49
|
+
$ autovrsion create
|
50
|
+
or
|
51
|
+
$ autovrsion create /path/to/repository
|
47
52
|
|
48
53
|
$ autovrsion start
|
49
|
-
|
50
|
-
|
54
|
+
or
|
55
|
+
$ autovrsion start /path/to/repository
|
51
56
|
|
52
57
|
$ autovrsion display
|
53
|
-
|
54
|
-
|
58
|
+
or
|
59
|
+
$ autovrsion display /path/to/repository
|
55
60
|
|
56
61
|
$ autovrsion check
|
57
|
-
|
58
|
-
|
62
|
+
or
|
63
|
+
$ autovrsion check /path/to/repository
|
59
64
|
|
60
65
|
$ autovrsion reset
|
61
|
-
|
62
|
-
|
66
|
+
or
|
67
|
+
$ autovrsion reset /path/to/repository
|
63
68
|
|
64
69
|
$ autovrsion rewind
|
65
|
-
|
66
|
-
|
70
|
+
or
|
71
|
+
$ autovrsion rewind /path/to/repository
|
72
|
+
|
data/autovrsion.gemspec
CHANGED
@@ -20,11 +20,12 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
-
spec.add_runtime_dependency "ruby-git"
|
24
|
-
spec.add_runtime_dependency "rugged"
|
25
|
-
spec.add_runtime_dependency "git"
|
26
|
-
spec.add_runtime_dependency "listen"
|
27
|
-
spec.add_runtime_dependency "
|
23
|
+
spec.add_runtime_dependency "ruby-git"
|
24
|
+
spec.add_runtime_dependency "rugged"
|
25
|
+
spec.add_runtime_dependency "git"
|
26
|
+
spec.add_runtime_dependency "listen", "~> 3.0"
|
27
|
+
spec.add_runtime_dependency "daemons"
|
28
|
+
spec.add_runtime_dependency "colored"
|
28
29
|
|
29
30
|
spec.add_development_dependency "bundler", "~> 1.5"
|
30
31
|
spec.add_development_dependency "rake"
|
@@ -4,12 +4,12 @@ require 'listen'
|
|
4
4
|
require 'colored'
|
5
5
|
|
6
6
|
class FileListen
|
7
|
-
def lis(path,option)
|
7
|
+
def lis(path,option)
|
8
8
|
begin
|
9
9
|
puts "Listening to changes.enter "+"stop ".red+"or"+" 1 ".red+"to stop listening to changes"
|
10
10
|
repo=Rugged::Repository.new(path)
|
11
|
-
listener = Listen.to(path,only: [/^^[\/[a-zA-Z]*]*["Untitled Document"]/,/^[\/[a-zA-Z]*]*[".git"]/]) do |modified,added,removed|
|
12
|
-
|
11
|
+
listener = Listen.to(path,only: [/^^[\/[a-zA-Z]*]*["Untitled Document"]/,/^[\/[a-zA-Z]*]*[".git"]/]) do |modified,added,removed|
|
12
|
+
|
13
13
|
index = repo.index
|
14
14
|
user = {
|
15
15
|
name: repo.config['user.name'],
|
@@ -17,7 +17,7 @@ class FileListen
|
|
17
17
|
time: Time.now
|
18
18
|
}
|
19
19
|
|
20
|
-
commit_options = {}
|
20
|
+
commit_options = {}
|
21
21
|
commit_options[:author] = user
|
22
22
|
commit_options[:committer] = user
|
23
23
|
commit_options[:parents] = repo.empty? ? [] : [ repo.head.target ].compact
|
@@ -28,7 +28,7 @@ class FileListen
|
|
28
28
|
modified.each do |x|
|
29
29
|
x.gsub!(/[a-zA-Z]*[\/]/,"")
|
30
30
|
puts x
|
31
|
-
index.add("#{x}")
|
31
|
+
index.add("#{x}")
|
32
32
|
end
|
33
33
|
|
34
34
|
commit_options[:tree] = index.write_tree(repo)
|
@@ -37,10 +37,10 @@ class FileListen
|
|
37
37
|
m.each do |x|
|
38
38
|
x.gsub!(/(\[)(\/[a-zA-Z]*)*(\/)/,"")
|
39
39
|
x.gsub!(/\]/,"")
|
40
|
-
puts x
|
41
|
-
end
|
40
|
+
puts x
|
41
|
+
end
|
42
42
|
commit_options[:message] ||= "#{m} modified at "+"#{Time.now}"
|
43
|
-
|
43
|
+
|
44
44
|
Rugged::Commit.create(repo,commit_options)
|
45
45
|
puts "File Modified".yellow
|
46
46
|
end
|
@@ -61,8 +61,8 @@ class FileListen
|
|
61
61
|
x.gsub!(/(\[)(\/[a-zA-Z]*)*(\/)/,"")
|
62
62
|
x.gsub!(/\]/,"")
|
63
63
|
puts x
|
64
|
-
end
|
65
|
-
|
64
|
+
end
|
65
|
+
|
66
66
|
index.write
|
67
67
|
commit_options[:message] ||= " #{a} added at "+"#{Time.now}"
|
68
68
|
if a[0] != "Untitled Document"
|
@@ -72,7 +72,7 @@ class FileListen
|
|
72
72
|
end
|
73
73
|
|
74
74
|
if removed.empty? == false
|
75
|
-
|
75
|
+
|
76
76
|
index.reload
|
77
77
|
r = removed
|
78
78
|
index.add_all
|
@@ -80,7 +80,7 @@ class FileListen
|
|
80
80
|
r.each do |x|
|
81
81
|
x.gsub!(/(\[)(\/[a-zA-Z]*)*(\/)/,"")
|
82
82
|
x.gsub!(/\]/,"")
|
83
|
-
end
|
83
|
+
end
|
84
84
|
index.write
|
85
85
|
commit_options[:message] ||= "#{r} removed at "+"#{Time.now}"
|
86
86
|
if r[0] != "Untitled Document"
|
@@ -94,16 +94,16 @@ class FileListen
|
|
94
94
|
stop = STDIN.gets
|
95
95
|
if stop == "stop"
|
96
96
|
puts "Listener stopped"
|
97
|
-
listener.stop
|
98
|
-
end
|
97
|
+
listener.stop
|
98
|
+
end
|
99
99
|
|
100
100
|
if stop.to_i == 1
|
101
101
|
listener.stop
|
102
|
-
abort"Listener stopped"
|
103
|
-
end
|
102
|
+
abort"Listener stopped"
|
103
|
+
end
|
104
104
|
rescue Errno::ENOENT
|
105
105
|
puts "Error !Path does not exist".red
|
106
|
-
end
|
106
|
+
end
|
107
107
|
end
|
108
108
|
|
109
|
-
end
|
109
|
+
end
|
data/lib/autovrsion/version.rb
CHANGED
metadata
CHANGED
@@ -1,111 +1,125 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autovrsion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shaunak Pagnis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-git
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rugged
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0
|
33
|
+
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: git
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: listen
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: '3.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: daemons
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: colored
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
|
-
- -
|
87
|
+
- - ">="
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
89
|
+
version: '0'
|
76
90
|
type: :runtime
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
|
-
- -
|
94
|
+
- - ">="
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: bundler
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
|
-
- - ~>
|
101
|
+
- - "~>"
|
88
102
|
- !ruby/object:Gem::Version
|
89
103
|
version: '1.5'
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
|
-
- - ~>
|
108
|
+
- - "~>"
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
version: '1.5'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rake
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
|
-
- -
|
115
|
+
- - ">="
|
102
116
|
- !ruby/object:Gem::Version
|
103
117
|
version: '0'
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
|
-
- -
|
122
|
+
- - ">="
|
109
123
|
- !ruby/object:Gem::Version
|
110
124
|
version: '0'
|
111
125
|
description: A command line that uses Rugged and Listen for automatic versioning of
|
@@ -117,7 +131,7 @@ executables:
|
|
117
131
|
extensions: []
|
118
132
|
extra_rdoc_files: []
|
119
133
|
files:
|
120
|
-
- .gitignore
|
134
|
+
- ".gitignore"
|
121
135
|
- Gemfile
|
122
136
|
- LICENSE.txt
|
123
137
|
- README.md
|
@@ -143,17 +157,17 @@ require_paths:
|
|
143
157
|
- lib
|
144
158
|
required_ruby_version: !ruby/object:Gem::Requirement
|
145
159
|
requirements:
|
146
|
-
- -
|
160
|
+
- - ">="
|
147
161
|
- !ruby/object:Gem::Version
|
148
162
|
version: '0'
|
149
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
164
|
requirements:
|
151
|
-
- -
|
165
|
+
- - ">="
|
152
166
|
- !ruby/object:Gem::Version
|
153
167
|
version: '0'
|
154
168
|
requirements: []
|
155
169
|
rubyforge_project:
|
156
|
-
rubygems_version: 2.
|
170
|
+
rubygems_version: 2.4.8
|
157
171
|
signing_key:
|
158
172
|
specification_version: 4
|
159
173
|
summary: Command line tool for automatic versioning of files in a repository
|