valor-dual 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. data/lib/valor-dual.rb +15 -6
  2. metadata +4 -3
data/lib/valor-dual.rb CHANGED
@@ -1,6 +1,3 @@
1
- require 'yaml'
2
- require 'uri'
3
-
4
1
  class ValorDual
5
2
 
6
3
  def initialize(path)
@@ -48,9 +45,21 @@ class ValorDual
48
45
  return @array_of_dumps
49
46
  end
50
47
 
51
- def fetch version
52
- version_name = @array_of_dumps.find{|i| i['version'] == version }
53
- (version_name.nil?) ? "Specify correct version" : version_name["public_url"]
48
+ def fetch (version = nil)
49
+ if version.nil?
50
+ return @array_of_dumps.map{|i| i["public_url"]}
51
+ end
52
+
53
+ if self.is_version?(version) == true
54
+ return @array_of_dumps.find{|i| i['version'] == version }["public_url"]
55
+ else
56
+ return "Invalid version, check your config file"
57
+ end
58
+
59
+ end
60
+
61
+ def is_version?(version)
62
+ is_version = @versions.any?{ |key, value| key == version}
54
63
  end
55
64
 
56
65
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: valor-dual
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
- - Ashutosh J
8
+ - Ashutosh Jha
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
@@ -51,7 +51,7 @@ extensions: []
51
51
  extra_rdoc_files: []
52
52
  files:
53
53
  - lib/valor-dual.rb
54
- homepage: http://rubygems.org/gems/hola
54
+ homepage: http://rubygems.org/gems/valor-dual
55
55
  licenses:
56
56
  - ''
57
57
  post_install_message:
@@ -77,3 +77,4 @@ signing_key:
77
77
  specification_version: 3
78
78
  summary: Valor-Dual - image resizer!
79
79
  test_files: []
80
+ has_rdoc: