opener-core 0.0.1 → 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
- YThlMjhjYzdhNWY2NWVhNTIwZTM3Mjg4ODc5N2U4YzU3ZTQwYTgwMQ==
5
- data.tar.gz: !binary |-
6
- NTNiY2JlNDVkN2FiNjg1NThmN2E4OWVlOGE0ZWNkZmJkYmNmZGE3NA==
2
+ SHA1:
3
+ metadata.gz: 4595374da4a22a9a9b646593316e29b4431ecad5
4
+ data.tar.gz: 6539e323d362e3b95a282f41708e4a573d7926f1
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NmJkOTkyZDdhOTZhZmM3YWM4OGM3NTBkY2JhMDBkMWM1NzIzZGYyZDZhYzlk
10
- MjQ2MDM0NjcxYmYxOTgyMTMzZDI1NTFkYjM4YzU3M2JjMjhiOWIwMTc1NDAy
11
- ODc3ZjhiNWUwNDQ1MDdlNTAxMWY5OGQ5MjNkMjMwMjYyNDNlOTM=
12
- data.tar.gz: !binary |-
13
- ZjE2ZDZkNGNkZTJlYWRiYTEyYWJmMmRhMDNhZDcxZGQ1MDBiZGQxMTg0MmZm
14
- NTVhZmZjNzNkNTgyMmQwN2IxOGE5Y2Q5NGQzYjVhMzdmMmRlNWNlYjA4MWM1
15
- ZWY1MjU3ZWFkYTg2NWZjZjM0MGRmYWUyNmM0MzE4NTFjZDhiM2Q=
6
+ metadata.gz: a4084a37b807373ed99d0208ad060ad86f58376849f80a1a5f9bfc92ebd6a57515bbe48cfa1f7bfeaf03c32043577604240f5ced9d0683d2cae76944c683d787
7
+ data.tar.gz: 74be558727b785f892cfc2e5ca190ff4020a2619680ab70e5039b923192eb468f380338a3acaaff42ad4b74a2d2bcdaebc645f341e7c70f85ff5c7e648ad17a1
@@ -0,0 +1,19 @@
1
+ module Opener
2
+ module Core
3
+ class ArgvSplitter
4
+
5
+ def self.split(args, char="--")
6
+ if index = args.index(char)
7
+ first = args[0..index-1]
8
+ second = args[index+1..-1]
9
+ else
10
+ first = args
11
+ second = []
12
+ end
13
+
14
+ [first,second]
15
+ end
16
+ end
17
+ end
18
+ end
19
+
@@ -10,8 +10,8 @@ module Opener
10
10
  OptParser.bind(opts,options)
11
11
  end
12
12
 
13
- def install(options)
14
- Installer.new(options).install
13
+ def install(options, force=true)
14
+ Installer.new(options).install(force)
15
15
  end
16
16
 
17
17
  class Installer
@@ -21,8 +21,14 @@ module Opener
21
21
  @options = options
22
22
  end
23
23
 
24
- def install
25
- path = options.fetch(:resource_path) { raise ArgumentError, "No resource-path given" }
24
+ def install(force=true)
25
+ return if !options[:resource_path] && !options[:resource_url]
26
+
27
+ path = options[:resource_path]
28
+ if options[:resource_url] || (path.nil? && force)
29
+ raise ArgumentError, "No resource-path given"
30
+ end
31
+
26
32
  if url = options[:resource_url]
27
33
  download_and_unzip_resource(url,path)
28
34
  end
@@ -1,5 +1,5 @@
1
1
  module Opener
2
2
  module Core
3
- VERSION = "0.0.1"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opener-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - development@olery.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-21 00:00:00.000000000 Z
11
+ date: 2014-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.5'
20
20
  type: :development
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: '1.5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: Gem that contains some low lever generic functions for all OpeNER components.
@@ -44,12 +44,13 @@ executables: []
44
44
  extensions: []
45
45
  extra_rdoc_files: []
46
46
  files:
47
+ - README.md
48
+ - lib/opener/core.rb
49
+ - lib/opener/core/argv_splitter.rb
47
50
  - lib/opener/core/opt_parser.rb
48
51
  - lib/opener/core/resource_switcher.rb
49
52
  - lib/opener/core/version.rb
50
- - lib/opener/core.rb
51
53
  - opener-core.gemspec
52
- - README.md
53
54
  homepage: http://opener-project.github.com
54
55
  licenses:
55
56
  - Apachev2
@@ -60,18 +61,19 @@ require_paths:
60
61
  - lib
61
62
  required_ruby_version: !ruby/object:Gem::Requirement
62
63
  requirements:
63
- - - ! '>='
64
+ - - ">="
64
65
  - !ruby/object:Gem::Version
65
66
  version: '0'
66
67
  required_rubygems_version: !ruby/object:Gem::Requirement
67
68
  requirements:
68
- - - ! '>='
69
+ - - ">="
69
70
  - !ruby/object:Gem::Version
70
71
  version: '0'
71
72
  requirements: []
72
73
  rubyforge_project:
73
- rubygems_version: 2.1.11
74
+ rubygems_version: 2.2.2
74
75
  signing_key:
75
76
  specification_version: 4
76
77
  summary: Gem that contains some low lever generic functions for all OpeNER components.
77
78
  test_files: []
79
+ has_rdoc: