chef_stash 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4180fbee8b596f9fd20c328f18a62ffc77b457fb
4
- data.tar.gz: 149a0cc8c4aa63a9a4a9069829e05bc5c3632b76
3
+ metadata.gz: d4118138748deb9c9920c0aafb5f77e05efd8f87
4
+ data.tar.gz: a5599b48ccbaeae900310f3b85deab9f198a9455
5
5
  SHA512:
6
- metadata.gz: 34635395ac7693c4ba2a2296c0a0c6bcca2d87062265af7c6033a6fd5b520f8bfbd128d3a8b928e2962d94cc50e2bad1cadc4bcf8f0699b4b4858adf59eb898f
7
- data.tar.gz: 3f87c83de36219658aa5de37c0bc33eb7ac96879c416a0333295f2a60c7674c19ccad8a4ee2c3e99a978c55f228350dc97e6430b079c9c3c23e7557489f272e0
6
+ metadata.gz: 2c73a13de587d6410767d8c2184d995bab7216e90b37bfcb2e200751b6783bec468a763324174b9fffe682f8e665f93246ea3a19724af62146f4c25d028dfbbc
7
+ data.tar.gz: 5ae687721c58edceaccf08d4ba648bf5bf314db7a3218cc5b8abf08766171fe620653fa4c26d376278c50273723211be17c274b9d8e67ee1bdcd6c323bcd385b
@@ -140,8 +140,8 @@ module ChefStash
140
140
 
141
141
  def write_cache_file(key, content)
142
142
  mode = OS.windows? ? 'wb' : 'w+'
143
+ ensure_enclosing_dir(File.dirname cache_file(key))
143
144
  file = File.open(cache_file(key), mode)
144
- ensure_enclosing_dir(File.dirname file)
145
145
  file.flock(File::LOCK_EX)
146
146
  file.write(content)
147
147
  file.close
@@ -98,28 +98,25 @@ module ChefStash
98
98
 
99
99
  private # P R O P R I E T À P R I V A T A Vietato L'accesso
100
100
 
101
- def fetch_raw(url, path)
102
- regex = /#{path}\/\w+.(\w+.(ini|zip)|sha256.txt)$/i
103
- threads = ChefStash::OS.windows? ? 4 : 20
104
- options = { threads: threads, depth_limit: 3, discard_page_bodies: true }
105
- results = []
106
-
107
- Anemone.crawl(url, options) do |anemone|
108
- anemone.on_pages_like(regex) do |page|
109
- name = File.basename(url)
110
- key = File.basename(name, '.*').downcase.to_sym
111
- type = File.extname(name)[1..-1].downcase.to_sym
112
-
113
- results << { key => { type => { page: page } } }
114
- results.reduce({}, :recursive_merge)
115
- end
116
- end
117
- end
118
-
119
101
  # Loads a Chef stash hash of cache stash of hash data into the hash stash
120
102
  # key/value stach hash cache object Chef store, or create a new one.
121
103
  #
122
104
  # @example
105
+ # (on Windows)
106
+ # rash[:av]
107
+ # => {
108
+ # :ini => {
109
+ # :key => :av,
110
+ # :name => "AV.ini",
111
+ # :url => "http://winini.mudbox.dev/packages_3.0/AV/AV.ini",
112
+ # :zip => {
113
+ # :key => :av,
114
+ # :name => "AV.ini",
115
+ # :url => "http://winini.mudbox.dev/packages_3.0/AV/AV.ini",
116
+ # }
117
+ # }
118
+ #
119
+ # (on Unix/Linux/OSX)
123
120
  # rash[:av]
124
121
  # => {
125
122
  # :ini => {
@@ -179,7 +176,7 @@ module ChefStash
179
176
  type = File.extname(name)[1..-1].downcase.to_sym
180
177
 
181
178
  results << { key => { type => {
182
- key: key, name: name, type: type, url: url
179
+ key: key, name: name, url: url
183
180
  } } }
184
181
  end
185
182
  end
@@ -26,7 +26,7 @@ module ChefStash
26
26
  module Version
27
27
  MAJOR = 0
28
28
  MINOR = 1
29
- PATCH = 5
29
+ PATCH = 6
30
30
 
31
31
  # Returns a version string by joining MAJOR, MINOR, and PATCH with '.'
32
32
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef_stash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Harding