dssx 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- N2I0ZTA0ZjgwMDE1ZGE1OWZlM2E5MDk1ZmJmMDkyYjRiZWI1NTRjZg==
5
- data.tar.gz: !binary |-
6
- N2NjMTJjY2FkZTlhMDI0Y2Y2ZWFmMTQ2ZjJjNjNlNGQyNWU0NDg3ZQ==
2
+ SHA1:
3
+ metadata.gz: e2d3940b71751b2d25d693c1273348eede8ab993
4
+ data.tar.gz: 55cb1b41dc02a79467703dca3e77afebcd7a0f9f
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NjRhZTA0MGQ1NzZmMzc1OWQ3OWUzZjJlNDE1MTg3NWJkMzQyOThmOGViYzEx
10
- NTAzYjE3MzI0YTJmOTZlZTNjZDQxZDlmNDE0NmNjMzRkN2Y4MTRmYjUxZTk0
11
- ZjExMDliNTNhMWM0YjczODVmNDczNmU1ZmMwZDcyNTgxZGNmZDQ=
12
- data.tar.gz: !binary |-
13
- ZTRlZmNkMTc1NDk1NDdhOGZiY2MzZGQzYzAyNTQyNzFiYWQwMjA2OTU5NWYx
14
- MmViYTI1ODIyYjk2ZTA0NGRmZDAzYmQ0NzhiNmQ4NWMxODNlZmM1OWIxOGQx
15
- YTY0ODUwNDEyNzZkZDQ0NTY1NjFiNWM0MjczZDYzMDA0ODE4MDk=
6
+ metadata.gz: ae085f31cbd487fb2d7b42ca0f2255212ae4a1ba9964493537459cdca8e16a6fd369548a4a688d77fef11fbb61cb02cbf6e9bfed0ff2d7dbb1b1ae724482b36f
7
+ data.tar.gz: 85980bbfb8920e072ffe5809b649bfe2443f1514ef75795754d6f4ce3a04622ddfe0a8cfbe93e615bda64089d0cef743db019edbc28a1220d335b34126953cf8
@@ -1 +1 @@
1
- ruby-1.9.3
1
+ ruby-2.1.5
data/README.md CHANGED
@@ -27,3 +27,8 @@ EXAMPLES
27
27
 
28
28
  Replacing dssc_simple_report
29
29
  dssx status path
30
+
31
+ .dssxignore
32
+ --
33
+
34
+ From version 0.1.0, '.dssxignore' files are supported. A global file can be placed in a users home directory and starting with the current folder a hierarchical search is performed until an ignore file is found or '/' is reached.
@@ -1,4 +1,3 @@
1
-
2
1
  gem_name = 'dssx'
3
2
  require File.join( File.dirname(__FILE__), 'lib', gem_name )
4
3
 
@@ -8,7 +7,8 @@ Gem::Specification.new do |s|
8
7
  s.platform = Gem::Platform::RUBY
9
8
  s.authors = ["Morgan Prior"]
10
9
  s.email = ["morgan@amaras-tech.co.uk"]
11
- s.homepage = ""
10
+ s.homepage = "https://github.com/morganp/dssx"
11
+ s.license = "BSD-3-Clause"
12
12
  s.summary = %q{ruby library for dssc revision control system. }
13
13
  s.description = %q{ruby library for dssc revision control system.
14
14
  Binary dssx included with many commands such as dssx status for short status reports modeled after 'svn status -u'
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Dssx
3
- VERSION = '0.0.3'
3
+ VERSION = '0.1.0'
4
4
  end
5
5
 
6
6
  begin
@@ -152,10 +152,60 @@ module Dssx
152
152
  end
153
153
  end
154
154
 
155
+ #Remove files listed in the .dssxignore file
156
+ items = dssxignore( items )
157
+
155
158
  #display items
156
159
  return items
157
160
  end
158
161
 
162
+ def dssxignore(items)
163
+ #Load ignore file
164
+ ignore_list = find_and_load_ignore_list
165
+
166
+ #Delete if pattern match found
167
+ items.delete_if do |this_item|
168
+ blocked = ignore_list.any? do | pattern |
169
+ File.fnmatch( pattern, this_item.path )
170
+ end
171
+ end
172
+
173
+ return items
174
+ end
175
+
176
+ def find_and_load_ignore_list
177
+ file = ".dssxignore"
178
+ path = Dir.home
179
+
180
+ ignore_list = Array.new
181
+
182
+ #Add Global dssx ignore if present
183
+ path_file = File.join(path, file)
184
+ if File.exist?( path_file )
185
+ ignore_list = *File.read( path_file ).split
186
+ end
187
+
188
+ path = Dir.pwd
189
+ ignore_list = ignore_list + search_for_ignore(path, file)
190
+
191
+ return ignore_list.uniq
192
+ end
193
+
194
+ def search_for_ignore(path, file)
195
+ path_file = File.join(path, file)
196
+
197
+ if File.exist?( path_file )
198
+ return *File.read( path_file ).split
199
+ elsif path == '/'
200
+ # Detect at top level nowhere left to search
201
+ return []
202
+ else
203
+ # Iterate looking in the parent folder
204
+ search_for_ignore( File.expand_path("..", path), file )
205
+ end
206
+ end
207
+
208
+
159
209
  def cached_results
160
210
  @results ||= run_dssc_ls_mock
161
211
  end
metadata CHANGED
@@ -1,30 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dssx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Morgan Prior
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-09 00:00:00.000000000 Z
11
+ date: 2015-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.16.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
26
  version: 0.16.0
27
- description: ! "ruby library for dssc revision control system.\n Binary dssx included
27
+ description: "ruby library for dssc revision control system.\n Binary dssx included
28
28
  with many commands such as dssx status for short status reports modeled after 'svn
29
29
  status -u' \n "
30
30
  email:
@@ -34,9 +34,9 @@ executables:
34
34
  extensions: []
35
35
  extra_rdoc_files: []
36
36
  files:
37
- - .gitignore
38
- - .ruby-gemset
39
- - .ruby-version
37
+ - ".gitignore"
38
+ - ".ruby-gemset"
39
+ - ".ruby-version"
40
40
  - Gemfile
41
41
  - LICENSE
42
42
  - README.md
@@ -49,8 +49,9 @@ files:
49
49
  - spec/dssx_spec.rb
50
50
  - spec/fixtures/mock_output.txt
51
51
  - spec/spec_helper.rb
52
- homepage: ''
53
- licenses: []
52
+ homepage: https://github.com/morganp/dssx
53
+ licenses:
54
+ - BSD-3-Clause
54
55
  metadata: {}
55
56
  post_install_message:
56
57
  rdoc_options: []
@@ -58,17 +59,17 @@ require_paths:
58
59
  - lib
59
60
  required_ruby_version: !ruby/object:Gem::Requirement
60
61
  requirements:
61
- - - ! '>='
62
+ - - ">="
62
63
  - !ruby/object:Gem::Version
63
64
  version: '0'
64
65
  required_rubygems_version: !ruby/object:Gem::Requirement
65
66
  requirements:
66
- - - ! '>='
67
+ - - ">="
67
68
  - !ruby/object:Gem::Version
68
69
  version: '0'
69
70
  requirements: []
70
71
  rubyforge_project:
71
- rubygems_version: 2.2.2
72
+ rubygems_version: 2.4.3
72
73
  signing_key:
73
74
  specification_version: 4
74
75
  summary: ruby library for dssc revision control system.