daun 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjNlMzI4N2NiMGRjM2Y5YzcyYTMxMzhhNGE0M2YzNDBkNjhjMWUwZQ==
4
+ OTIzNWE5NDBmNTFhM2Q0NzI1ZWUyYWVmYzFkOWU5NjA0ZGI5NzUwMg==
5
5
  data.tar.gz: !binary |-
6
- NjBlOGNlZGUxNTUyZmZjOWQ1ZDM3ZTE1MzA2ZDYwOWM2YzQzNDQzNA==
6
+ MDU2YTkwM2ViNjY4YTc1MGM1ZjQwYTM3ZWU0MmJkZTYzMWJkOTljYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTIyMWNkMDdlYmEwYWE3ZGYzZTFmMjg5OGEyOGZhYzIxZGQyZTdiNWQxMWZi
10
- YzNlZTg0N2MyZDM1YzAwOGU1ZTRkODZlZWY2MjVlODFiYTFlYzQ5YTVmZTYx
11
- ZjkwYWEyMWI0NmUwMDJkYWZkNzcyOGJkOWYxMjZlMDZmOGMzNDA=
9
+ NDhlODUwNjkxZjkzZjJjM2MzMDQ2YjE2NTAwODMwMzYyMGIyMmM1YTllMDY4
10
+ MGY2N2VlYTg4ODY3MmE4OTIzOGNmMGY4OWM4OTI5MTIyYjUxZjYyOWM0ODZl
11
+ NDVkYTEzYjRmNTBkMzdhNDdlYjFhNDVjYzAwY2MwYTBmMDkxODU=
12
12
  data.tar.gz: !binary |-
13
- ZGM3NWVjYzI5NzgxZjFjYTU3NDIwNDJlNmNkYTc1OTMzZDJkZjgzYWNiMjI0
14
- ZDJhNzQ1MWFlNTIwM2YwYWFmZGVhZDUzMjVmZmI0MWM1NjViMDRkMmE2M2Y2
15
- NWVmOTNkMTkzMWIxMDFhODdhODZhYmRhOGY1ZmIxODEyZGZiZDE=
13
+ MTJlNTY1M2I4ODMzMzFiNDc1NTBhOWE2NTAwZGEwZTk1M2JlMzU3ZDNiY2Fh
14
+ ZjBlYzYyNzYyOTAwYWZkMGY1ODA3NTU1NTlhMDQ2Yjg3Nzc0ZDYxZTQ4YTNk
15
+ NTE0NjlhYWMzM2JiMzAxMDJkYjI2N2M1MzkyZGRiNWE5N2M4Nzg=
@@ -12,6 +12,9 @@ Metrics/AbcSize:
12
12
  Enabled: false
13
13
  Max: 20
14
14
 
15
+ Metrics/ClassLength:
16
+ Max: 250
17
+
15
18
  # Conflicts with IntelliJ auto formatting
16
19
  Style/MultilineMethodCallIndentation:
17
20
  Enabled: false
@@ -0,0 +1,19 @@
1
+ # Change Log
2
+
3
+ ## [Unreleased]
4
+
5
+ ## [0.1.3] - 2016-10-26
6
+ ### Fixed
7
+ \#3 Unable to checkout after setting daun.tag.limit
8
+
9
+ ## [0.1.2]
10
+ ### Changed
11
+ - Gemspec description and ruby version requirement
12
+
13
+ ## 0.1.0
14
+ ### Added
15
+ - Initial release.
16
+
17
+ [Unreleased]: https://github.com/ceilfors/daun/compare/v0.1.3...HEAD
18
+ [0.1.2]: https://github.com/ceilfors/daun/compare/v0.1.0...v0.1.2
19
+ [0.1.3]: https://github.com/ceilfors/daun/compare/v0.1.2...v0.1.3
data/README.md CHANGED
@@ -13,13 +13,6 @@ Daun is originally designed to help index your source code in [OpenGrok](https:/
13
13
 
14
14
  ## Installation
15
15
 
16
- #### Linux
17
-
18
- $ gem install daun
19
-
20
- #### Other OS
21
-
22
- $ gem install rugged
23
16
  $ gem install daun
24
17
 
25
18
  Daun uses [`rugged`](https://github.com/libgit2/rugged) gem to talk to git repositories. As of today, this gem
@@ -28,6 +21,8 @@ can [be](https://github.com/libgit2/rugged/issues/43)
28
21
  to be installed in OS other than Linux hence it has been made an optional dependency.
29
22
  Because of this, you have to be able to install rugged gem manually first before
30
23
  installing daun. Visit rugged documentation if you have problem installing rugged.
24
+ If you are using chef, consider checking [cookbook-daun](https://github.com/ceilfors/cookbook-daun)
25
+ recipe out which will help you install daun/rugged smoothly.
31
26
 
32
27
  ## Usage
33
28
 
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency 'rspec', '~> 3.0'
31
31
  spec.add_development_dependency 'simplecov', '~> 0.11', '>= 0.11.2'
32
32
  spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.6', '>= 0.6.0'
33
- spec.add_development_dependency 'rubocop', '~> 0.41', '>= 0.41.1'
33
+ spec.add_development_dependency 'rubocop', '< 0.42.0' # rubocop 0.42.0 requires ruby 2
34
34
  spec.add_development_dependency 'rspec_junit_formatter', '~> 0.2', '>= 0.2.2'
35
35
  spec.add_development_dependency 'yard', '~> 0.9', '>= 0.9.4'
36
36
  spec.add_development_dependency 'redcarpet', '~> 3.3', '>= 3.3.4'
@@ -38,11 +38,5 @@ Gem::Specification.new do |spec|
38
38
  spec.add_runtime_dependency 'json', '< 2' # json 2 requires ruby 2
39
39
  spec.add_runtime_dependency 'thor', '~> 0.19', '>= 0.19.1'
40
40
  spec.add_runtime_dependency 'logging', '~> 2.0'
41
-
42
- if RbConfig::CONFIG['host_os'] =~ /solaris|bsd|linux/
43
- spec.add_runtime_dependency 'rugged', '~> 0.21'
44
- else
45
- # Can't pull 0.24.0 yet because this depends on the libgit2 version installed locally
46
- spec.add_development_dependency 'rugged', '~> 0.23.0'
47
- end
41
+ spec.add_runtime_dependency 'rugged', '~> 0.21'
48
42
  end
@@ -0,0 +1,12 @@
1
+ # Add convenience methods to grab information from git refs
2
+ class String
3
+ # Grabs branch name from git remote refs.
4
+ def to_local_branch
5
+ self[%r{refs/remotes/origin/(.*)}, 1]
6
+ end
7
+
8
+ # Grabs tag name from git tag refs.
9
+ def to_tag
10
+ self[%r{refs/tags/(.*)}, 1]
11
+ end
12
+ end
@@ -1,5 +1,6 @@
1
1
  require 'rugged'
2
2
  require 'fileutils'
3
+ require 'core_ext/string'
3
4
 
4
5
  module Daun
5
6
  # Implementation of daun using Rugged library.
@@ -22,6 +23,11 @@ module Daun
22
23
  @repository.config['daun.branch.blacklist'] = ''
23
24
  end
24
25
 
26
+ # Returns the git repository config as hash.
27
+ def config
28
+ @repository.config
29
+ end
30
+
25
31
  # Checkout git branches and tags in the git repository working directory.
26
32
  #
27
33
  # This method will fetch the latest update from `git remote origin` configured
@@ -123,9 +129,11 @@ module Daun
123
129
  end
124
130
 
125
131
  def keep_new_tags(limit)
126
- @repository.tags.sort_by { |tag| tag.target.time }
127
- .take(@repository.tags.count - limit)
128
- .each { |t| @repository.tags.delete t.name }
132
+ if @repository.tags.count > limit
133
+ @repository.tags.sort_by { |tag| tag.target.time }
134
+ .take(@repository.tags.count - limit)
135
+ .each { |t| @repository.tags.delete t.name }
136
+ end
129
137
  end
130
138
 
131
139
  def get_checkout_directory(refs)
@@ -139,16 +147,3 @@ module Daun
139
147
  end
140
148
  end
141
149
  end
142
-
143
- # Add convenience methods to grab information from git refs
144
- class String
145
- # Grabs branch name from git remote refs.
146
- def to_local_branch
147
- self[%r{refs/remotes/origin/(.*)}, 1]
148
- end
149
-
150
- # Grabs tag name from git tag refs.
151
- def to_tag
152
- self[%r{refs/tags/(.*)}, 1]
153
- end
154
- end
@@ -1,3 +1,3 @@
1
1
  module Daun
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wisen Tanasa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-26 00:00:00.000000000 Z
11
+ date: 2016-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -96,22 +96,16 @@ dependencies:
96
96
  name: rubocop
97
97
  requirement: !ruby/object:Gem::Requirement
98
98
  requirements:
99
- - - ~>
100
- - !ruby/object:Gem::Version
101
- version: '0.41'
102
- - - ! '>='
99
+ - - <
103
100
  - !ruby/object:Gem::Version
104
- version: 0.41.1
101
+ version: 0.42.0
105
102
  type: :development
106
103
  prerelease: false
107
104
  version_requirements: !ruby/object:Gem::Requirement
108
105
  requirements:
109
- - - ~>
110
- - !ruby/object:Gem::Version
111
- version: '0.41'
112
- - - ! '>='
106
+ - - <
113
107
  - !ruby/object:Gem::Version
114
- version: 0.41.1
108
+ version: 0.42.0
115
109
  - !ruby/object:Gem::Dependency
116
110
  name: rspec_junit_formatter
117
111
  requirement: !ruby/object:Gem::Requirement
@@ -226,14 +220,14 @@ dependencies:
226
220
  requirements:
227
221
  - - ~>
228
222
  - !ruby/object:Gem::Version
229
- version: 0.23.0
230
- type: :development
223
+ version: '0.21'
224
+ type: :runtime
231
225
  prerelease: false
232
226
  version_requirements: !ruby/object:Gem::Requirement
233
227
  requirements:
234
228
  - - ~>
235
229
  - !ruby/object:Gem::Version
236
- version: 0.23.0
230
+ version: '0.21'
237
231
  description: Daun is a CLI program that will expand git branches and tags to your
238
232
  disk as directories. Daun will keep the expanded directories in sync whenever there
239
233
  are new, updated, or deleted tags and branches.
@@ -251,6 +245,7 @@ files:
251
245
  - .ruby-version
252
246
  - .travis.yml
253
247
  - .yardopts
248
+ - CHANGELOG.md
254
249
  - CODE_OF_CONDUCT.md
255
250
  - Gemfile
256
251
  - LICENSE.txt
@@ -260,6 +255,7 @@ files:
260
255
  - daun.gemspec
261
256
  - docs/Development.md
262
257
  - exe/daun
258
+ - lib/core_ext/string.rb
263
259
  - lib/daun.rb
264
260
  - lib/daun/cli.rb
265
261
  - lib/daun/refs_diff.rb