onboard 0.2.3 → 0.3.0
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 +8 -8
- data/.rubocop.yml +8 -0
- data/.travis.yml +6 -0
- data/Gemfile +11 -1
- data/README.md +18 -15
- data/Rakefile +19 -1
- data/lib/onboard/cli.rb +60 -71
- data/lib/onboard/confirm.rb +21 -12
- data/lib/onboard/core.rb +67 -0
- data/lib/onboard/download.rb +15 -10
- data/lib/onboard/extract.rb +57 -0
- data/lib/onboard/find.rb +13 -16
- data/lib/onboard/msg.rb +2 -3
- data/lib/onboard/patch.rb +38 -0
- data/lib/onboard/prepare.rb +93 -0
- data/lib/onboard/project.rb +61 -167
- data/lib/onboard/release.rb +56 -0
- data/lib/onboard/repo.rb +50 -63
- data/lib/onboard/repo_bridge.rb +43 -0
- data/lib/onboard/screen.rb +1 -3
- data/lib/onboard/source.rb +18 -0
- data/lib/onboard/validate.rb +52 -0
- data/lib/onboard/version.rb +1 -1
- data/onboard.gemspec +16 -15
- data/spec/spec_helper.rb +11 -0
- metadata +15 -3
@@ -0,0 +1,52 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems/package'
|
4
|
+
require 'thor'
|
5
|
+
|
6
|
+
require_relative 'confirm'
|
7
|
+
require_relative 'download'
|
8
|
+
require_relative 'extract'
|
9
|
+
require_relative 'project'
|
10
|
+
require_relative 'release'
|
11
|
+
require_relative 'repo'
|
12
|
+
|
13
|
+
module Onboard
|
14
|
+
class Validate < Thor
|
15
|
+
attr_reader :core, :project, :version
|
16
|
+
|
17
|
+
no_tasks do
|
18
|
+
def initialize(project, version = '', core = '', answer)
|
19
|
+
@answer = answer
|
20
|
+
@core = core
|
21
|
+
@project = project
|
22
|
+
@version = version
|
23
|
+
end
|
24
|
+
|
25
|
+
def hacked?(path, repo)
|
26
|
+
link = Download.new.build_link(project, version)
|
27
|
+
Download.new.fetch(link)
|
28
|
+
Extract.new(Download.new.path(link), link, path).x if verify(link, version)
|
29
|
+
changes = Repo.new(repo).st(true)
|
30
|
+
return !Confirm.new('Proceed?').q(answer) unless changes
|
31
|
+
end
|
32
|
+
|
33
|
+
def latest?(latest)
|
34
|
+
if Gem::Dependency.new('', "~> #{latest}").match?('', "#{version}")
|
35
|
+
say("#{project} is already at the latest version (#{latest}).", :yellow)
|
36
|
+
return true
|
37
|
+
else
|
38
|
+
return false
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def verify(file, v = '')
|
43
|
+
_version, md5 = Release.new(project, core).choose(v)
|
44
|
+
if md5 == Digest::MD5.file(Download.new.path(file)).hexdigest
|
45
|
+
return true
|
46
|
+
else
|
47
|
+
say("Verification failed for #{project} download!", :red)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
data/lib/onboard/version.rb
CHANGED
data/onboard.gemspec
CHANGED
@@ -4,21 +4,22 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'onboard/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'onboard'
|
8
8
|
spec.version = Onboard::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
11
|
-
spec.summary =
|
12
|
-
spec.description =
|
13
|
-
spec.homepage =
|
14
|
-
spec.
|
9
|
+
spec.authors = ['Nathaniel Hoag']
|
10
|
+
spec.email = ['info@nathanielhoag.com']
|
11
|
+
spec.summary = 'Automated Drupal contrib.'
|
12
|
+
spec.description = 'Checks, downloads, verifies, adds, and commits Drupal contrib modules.'
|
13
|
+
spec.homepage = 'https://github.com/nhoag/onboard'
|
14
|
+
spec.bindir = 'bin'
|
15
|
+
spec.license = 'MIT'
|
15
16
|
spec.files = `git ls-files -z`.split("\x0")
|
16
|
-
spec.executables = [
|
17
|
-
spec.test_files = spec.files.grep(
|
18
|
-
spec.require_paths = [
|
19
|
-
spec.add_dependency
|
20
|
-
spec.add_dependency
|
21
|
-
spec.add_dependency
|
22
|
-
spec.add_development_dependency
|
23
|
-
spec.add_development_dependency
|
17
|
+
spec.executables = ['onboard']
|
18
|
+
spec.test_files = spec.files.grep(/^(test|spec|features)\//)
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
spec.add_dependency 'nokogiri', '~> 1.6'
|
21
|
+
spec.add_dependency 'git', '~> 1.2'
|
22
|
+
spec.add_dependency 'thor', ['>= 0.19.1', '< 2']
|
23
|
+
spec.add_development_dependency 'bundler', '~> 1.6'
|
24
|
+
spec.add_development_dependency 'rake', '~> 0'
|
24
25
|
end
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onboard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathaniel Hoag
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -95,6 +95,8 @@ extensions: []
|
|
95
95
|
extra_rdoc_files: []
|
96
96
|
files:
|
97
97
|
- .gitignore
|
98
|
+
- .rubocop.yml
|
99
|
+
- .travis.yml
|
98
100
|
- Gemfile
|
99
101
|
- LICENSE.txt
|
100
102
|
- README.md
|
@@ -103,14 +105,23 @@ files:
|
|
103
105
|
- lib/onboard.rb
|
104
106
|
- lib/onboard/cli.rb
|
105
107
|
- lib/onboard/confirm.rb
|
108
|
+
- lib/onboard/core.rb
|
106
109
|
- lib/onboard/download.rb
|
110
|
+
- lib/onboard/extract.rb
|
107
111
|
- lib/onboard/find.rb
|
108
112
|
- lib/onboard/msg.rb
|
113
|
+
- lib/onboard/patch.rb
|
114
|
+
- lib/onboard/prepare.rb
|
109
115
|
- lib/onboard/project.rb
|
116
|
+
- lib/onboard/release.rb
|
110
117
|
- lib/onboard/repo.rb
|
118
|
+
- lib/onboard/repo_bridge.rb
|
111
119
|
- lib/onboard/screen.rb
|
120
|
+
- lib/onboard/source.rb
|
121
|
+
- lib/onboard/validate.rb
|
112
122
|
- lib/onboard/version.rb
|
113
123
|
- onboard.gemspec
|
124
|
+
- spec/spec_helper.rb
|
114
125
|
homepage: https://github.com/nhoag/onboard
|
115
126
|
licenses:
|
116
127
|
- MIT
|
@@ -135,4 +146,5 @@ rubygems_version: 2.2.2
|
|
135
146
|
signing_key:
|
136
147
|
specification_version: 4
|
137
148
|
summary: Automated Drupal contrib.
|
138
|
-
test_files:
|
149
|
+
test_files:
|
150
|
+
- spec/spec_helper.rb
|