hw 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/hw.rb CHANGED
@@ -1,9 +1,7 @@
1
1
  require 'git'
2
2
  require 'thor'
3
3
  require 'thor/group'
4
- require 'httparty'
5
- require 'active_support/all'
6
- require 'rails/generators/actions'
4
+ require 'rails/generators/base'
7
5
 
8
6
  module HW
9
7
  DEFAULT_SOURCE = "git@github.com:carrot/hw-packages.git" # CLI
data/lib/hw/actions.rb CHANGED
@@ -27,4 +27,3 @@ module HW::Actions
27
27
  create_file("app/workers/#{filename}", data, :verbose => false, &block)
28
28
  end
29
29
  end
30
-
data/lib/hw/cli.rb CHANGED
@@ -29,6 +29,7 @@ module HW
29
29
  desc "version", "display gem version information"
30
30
  def version
31
31
  dependency = Gem::Dependency.new('hw', Gem::Requirement::default)
32
+ puts Gem::SpecFetcher::fetcher.find_matching(dependency, true, false, false).inspect
32
33
  versions = Gem::SpecFetcher::fetcher.find_matching(dependency, true, false, false).collect do |entry|
33
34
  if tuple = entry.first
34
35
  tuple[1]
@@ -48,6 +49,7 @@ module HW
48
49
  end
49
50
 
50
51
  desc "update", "Update installed packages"
52
+ method_option :pull, :aliases => "-p", :type => :boolean, :default => "true", :desc => "Pull from remote sources"
51
53
  def update
52
54
  header "Updating hw"
53
55
 
@@ -59,31 +61,36 @@ module HW
59
61
  header "Adding default source to #{CONFIG_PATH}"
60
62
 
61
63
  create_file CONFIG_PATH
62
- invoke :add_source, ["default", DEFAULT_SOURCE]
64
+ self.class.new.invoke :add_source, ["default", DEFAULT_SOURCE] # self.class.new added else RSpec screws up.
63
65
  end
64
66
 
65
67
  # Iterate through sources and take appropriate actions. TODO: Refactor.
66
- HW::Sources.all.each do |name, url|
67
- begin
68
- path = "#{SOURCES_PATH}/#{name}"
69
- local = HW::Sources.local_source?(url)
68
+ if options["pull"]
69
+ HW::Sources.all.each do |name, url|
70
+ begin
71
+ path = "#{SOURCES_PATH}/#{name}"
72
+ local = HW::Sources.local_source?(url)
70
73
 
71
- unless local
72
- if File.exists?(path)
73
- Git.open(path).pull
74
- else
75
- Git.clone(url, name, :path => SOURCES_PATH) unless local
74
+ unless local
75
+ if File.exists?(path)
76
+ Git.open(path).pull
77
+ else
78
+ Git.clone(url, name, :path => SOURCES_PATH) unless local
79
+ end
76
80
  end
77
- end
78
81
 
79
- if local and !File.exists?(url)
80
- error "Local directory '#{url}' not found. Please check your sources at #{CONFIG_PATH}"
81
- else
82
- success "Successfully pulled updates from #{url} to #{SOURCES_PATH}#{name}"
82
+ if local and !File.exists?(url)
83
+ error "Local directory '#{url}' not found. Please check your sources at #{CONFIG_PATH}"
84
+ else
85
+ success "Successfully pulled updates from #{url} to #{SOURCES_PATH}#{name}"
86
+ end
87
+ rescue Git::GitExecuteError => e
88
+ warn "Nothing was pulled from #{url}"
83
89
  end
84
- rescue Git::GitExecuteError => e
85
- warn "Nothing was pulled from #{url}"
86
90
  end
91
+ else
92
+ warn "Sources not updated"
93
+ info "Remove --pull=false to update your sources"
87
94
  end
88
95
  end
89
96
  end
data/lib/hw/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module HW
2
2
  MAJOR = 1
3
3
  MINOR = 1
4
- TINY = 4
4
+ TINY = 5
5
5
  PRE = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, TINY, PRE].compact.join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hw
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-17 00:00:00.000000000 Z
12
+ date: 2013-03-20 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: bundler
16
- requirement: &70210112888160 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: *70210112888160
25
14
  - !ruby/object:Gem::Dependency
26
15
  name: thor
27
- requirement: &70210112887640 !ruby/object:Gem::Requirement
16
+ requirement: &70133764491000 !ruby/object:Gem::Requirement
28
17
  none: false
29
18
  requirements:
30
19
  - - ! '>='
@@ -35,54 +24,21 @@ dependencies:
35
24
  version: '2.0'
36
25
  type: :runtime
37
26
  prerelease: false
38
- version_requirements: *70210112887640
39
- - !ruby/object:Gem::Dependency
40
- name: rails
41
- requirement: &70210112886960 !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ! '>='
45
- - !ruby/object:Gem::Version
46
- version: '0'
47
- type: :runtime
48
- prerelease: false
49
- version_requirements: *70210112886960
50
- - !ruby/object:Gem::Dependency
51
- name: rake
52
- requirement: &70210112886500 !ruby/object:Gem::Requirement
53
- none: false
54
- requirements:
55
- - - ! '>='
56
- - !ruby/object:Gem::Version
57
- version: '0'
58
- type: :runtime
59
- prerelease: false
60
- version_requirements: *70210112886500
61
- - !ruby/object:Gem::Dependency
62
- name: httparty
63
- requirement: &70210112886080 !ruby/object:Gem::Requirement
64
- none: false
65
- requirements:
66
- - - ! '>='
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- type: :runtime
70
- prerelease: false
71
- version_requirements: *70210112886080
27
+ version_requirements: *70133764491000
72
28
  - !ruby/object:Gem::Dependency
73
- name: pg
74
- requirement: &70210112885660 !ruby/object:Gem::Requirement
29
+ name: railties
30
+ requirement: &70133764490240 !ruby/object:Gem::Requirement
75
31
  none: false
76
32
  requirements:
77
- - - ! '>='
33
+ - - ~>
78
34
  - !ruby/object:Gem::Version
79
- version: '0'
35
+ version: '3.0'
80
36
  type: :runtime
81
37
  prerelease: false
82
- version_requirements: *70210112885660
38
+ version_requirements: *70133764490240
83
39
  - !ruby/object:Gem::Dependency
84
40
  name: git
85
- requirement: &70210112885240 !ruby/object:Gem::Requirement
41
+ requirement: &70133764489860 !ruby/object:Gem::Requirement
86
42
  none: false
87
43
  requirements:
88
44
  - - ! '>='
@@ -90,84 +46,7 @@ dependencies:
90
46
  version: '0'
91
47
  type: :runtime
92
48
  prerelease: false
93
- version_requirements: *70210112885240
94
- - !ruby/object:Gem::Dependency
95
- name: rspec-rails
96
- requirement: &70210112884820 !ruby/object:Gem::Requirement
97
- none: false
98
- requirements:
99
- - - ! '>='
100
- - !ruby/object:Gem::Version
101
- version: '0'
102
- type: :development
103
- prerelease: false
104
- version_requirements: *70210112884820
105
- - !ruby/object:Gem::Dependency
106
- name: ruby-prof
107
- requirement: &70210112884400 !ruby/object:Gem::Requirement
108
- none: false
109
- requirements:
110
- - - ! '>='
111
- - !ruby/object:Gem::Version
112
- version: '0'
113
- type: :development
114
- prerelease: false
115
- version_requirements: *70210112884400
116
- - !ruby/object:Gem::Dependency
117
- name: debugger
118
- requirement: &70210112883980 !ruby/object:Gem::Requirement
119
- none: false
120
- requirements:
121
- - - ! '>='
122
- - !ruby/object:Gem::Version
123
- version: '0'
124
- type: :development
125
- prerelease: false
126
- version_requirements: *70210112883980
127
- - !ruby/object:Gem::Dependency
128
- name: ronn
129
- requirement: &70210112883560 !ruby/object:Gem::Requirement
130
- none: false
131
- requirements:
132
- - - ! '>='
133
- - !ruby/object:Gem::Version
134
- version: '0'
135
- type: :development
136
- prerelease: false
137
- version_requirements: *70210112883560
138
- - !ruby/object:Gem::Dependency
139
- name: rspec
140
- requirement: &70210112883060 !ruby/object:Gem::Requirement
141
- none: false
142
- requirements:
143
- - - ~>
144
- - !ruby/object:Gem::Version
145
- version: '2.11'
146
- type: :development
147
- prerelease: false
148
- version_requirements: *70210112883060
149
- - !ruby/object:Gem::Dependency
150
- name: pry
151
- requirement: &70210112882640 !ruby/object:Gem::Requirement
152
- none: false
153
- requirements:
154
- - - ! '>='
155
- - !ruby/object:Gem::Version
156
- version: '0'
157
- type: :development
158
- prerelease: false
159
- version_requirements: *70210112882640
160
- - !ruby/object:Gem::Dependency
161
- name: sqlite3
162
- requirement: &70210112898540 !ruby/object:Gem::Requirement
163
- none: false
164
- requirements:
165
- - - ! '>='
166
- - !ruby/object:Gem::Version
167
- version: '0'
168
- type: :development
169
- prerelease: false
170
- version_requirements: *70210112898540
49
+ version_requirements: *70133764489860
171
50
  description: Package manager for random tasks
172
51
  email: tmilewski@gmail.com
173
52
  executables: