hoodie 0.2.9 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb99c1c25ad938bd25b993611aa6e7397f1f94cd
4
- data.tar.gz: 973fedbb4dfde8da96a3c5ed17c8281bc6220a95
3
+ metadata.gz: c75473209ad451c48645c1497a50544e6255f180
4
+ data.tar.gz: 9a5a69aef6017aa8eee8215980c5ff324238d56d
5
5
  SHA512:
6
- metadata.gz: 96fe5d6c96434594ffb226f137051dd21038511cda64b425673f1d1cc652664bac01b6f110c1c34ff2d6be2538d136199ed65f160cc4f1a00cf86a3210e8c56b
7
- data.tar.gz: 89f8bad5ae653c5c29dce750adf0ddc0f6de97b81a93d1506a8f6610e2fbb18f0f775301ff17540420822af0ed6931e0a386b44740108120f377ca197fe15be9
6
+ metadata.gz: 74cc2321a5fad2e06c4171a4053ada32eae4e0306d4a60d375a531e8de00e9af5048367d308a6ddba42348298523fd1ec40f3d4854524b640f6cca3fd7c7f677
7
+ data.tar.gz: f439b63e3b335496a0f43e69e64100684023cf9d519c765776e84c9f365e33c60a586c883c1c0d0f4334c13f390a4b3388ee6ce20ce544409bc6257d86111fc5
data/lib/hoodie/rash.rb CHANGED
@@ -24,9 +24,16 @@ require 'hoodie/memoizable' unless defined?(Memoizable)
24
24
  class Rash
25
25
  include Memoizable
26
26
 
27
- def initialize(node)
28
- @node = node
29
- memoize [:fetch, :version_path], Stash.new(DiskStash::Cache.new)
27
+ # Initializes a new store object.
28
+ #
29
+ # @param data [Hash] (optional) data to load into the stash.
30
+ #
31
+ # @return nothing.
32
+ #
33
+ def initialize(url, path)
34
+ @url = url
35
+ @path = path
36
+ memoize [:fetch], Stash.new(DiskStash::Cache.new)
30
37
  @store ||= fetch
31
38
  end
32
39
 
@@ -58,29 +65,14 @@ class Rash
58
65
 
59
66
  private # P R O P R I E T À P R I V A T A Vietato L'accesso
60
67
 
61
- # Returns os partial path to the file repository.
62
- #
63
- # @return [String] partial path to file repo
64
- #
65
- def version_path
66
- win_version = Chef::ReservedNames::Win32::Version.new
67
- version_path = case # Targeted platform path
68
- when win_version.windows_server_2008? then @node[:winini][:w2k8_package_path]
69
- when win_version.windows_server_2008_r2? then @node[:winini][:w2k8r2_package_path]
70
- when win_version.windows_server_2012_r2? then @node[:winini][:w2k12r2_package_path]
71
- else Chef::Log.warn 'This is not a supported Windows platform.'
72
- end
73
- version_path
74
- end
75
-
76
- # Creates or retrieves the rash key/value store for the node
68
+ # Loads a rash hash of data into the rash or create a new one.
77
69
  #
78
- # @return nothing
70
+ # @return nothing.
79
71
  #
80
72
  def fetch
81
73
  results = []
82
74
  Anemone.crawl(@url, discard_page_bodies: true) do |anemone|
83
- anemone.on_pages_like(/\/#{version_path}\/\w+\/\w+\.(ini|zip)$/i) do |page|
75
+ anemone.on_pages_like(/\/#{@path}\/\w+\/\w+\.(ini|zip)$/i) do |page|
84
76
  results << page.to_hash
85
77
  end
86
78
  end
@@ -18,5 +18,5 @@
18
18
  #
19
19
 
20
20
  module Hoodie
21
- VERSION = '0.2.9'
21
+ VERSION = '0.3.1'
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hoodie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Harding
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-15 00:00:00.000000000 Z
11
+ date: 2014-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: anemone