sweatshop_gears 1.0.1 → 1.0.2
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 +4 -4
- data/.rubocop.yml +1 -1
- data/Gemfile.lock +2 -2
- data/README.md +1 -0
- data/Rakefile +8 -8
- data/bin/sweatshop-gears +4 -3
- data/lib/robot_sweatshop/gears/base.rb +12 -4
- data/lib/robot_sweatshop/gears/binaries.rb +4 -3
- data/lib/robot_sweatshop/gears/dependencies.rb +1 -0
- data/lib/robot_sweatshop/gears/services.rb +1 -0
- data/lib/robot_sweatshop/gears/sweatshop_gears.eye.eruby +2 -2
- data/sweatshop_gears.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec1658e35ceb4fdbb0d685556ca88295e9208b80
|
4
|
+
data.tar.gz: 4590751c9868f8f5a07cc2fe5f67bbf774128fa4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c173f6f391b05e44e52004def9774b23caf2d839466de65ef8c83bc49bf7c6a86afe75cff8309d92f0b6647265408e4699a53e3042b6ddbf0f58fe84bc806148
|
7
|
+
data.tar.gz: 1ec9db87baf3c994e5109599ecd7d7ff18c9f51b33b7f9198530918d5e6d29ea7932a2eec15fda9e0082b2f17605182e2af6ad50ec7fd7558d813a08d5317462
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
|
4
|
+
sweatshop_gears (1.0.1)
|
5
5
|
bundler
|
6
6
|
commander
|
7
7
|
contracts
|
@@ -104,8 +104,8 @@ PLATFORMS
|
|
104
104
|
DEPENDENCIES
|
105
105
|
rake
|
106
106
|
riot
|
107
|
-
robot_sweatshop-gears!
|
108
107
|
simplecov
|
108
|
+
sweatshop_gears!
|
109
109
|
|
110
110
|
BUNDLED WITH
|
111
111
|
1.10.2
|
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -3,21 +3,21 @@ require 'rake'
|
|
3
3
|
task :test do
|
4
4
|
`sweatshop stop`
|
5
5
|
$stdout.sync = true
|
6
|
-
puts
|
7
|
-
IO.popen "bats #{__dir__}/test --pretty" do |
|
8
|
-
|
9
|
-
puts
|
6
|
+
puts 'sweatshop-gears'
|
7
|
+
IO.popen "bats #{__dir__}/test --pretty" do |io_stream|
|
8
|
+
while line = io_stream.gets
|
9
|
+
puts line
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
task :build do
|
15
15
|
print 'Building and installing local gem..'
|
16
|
-
`gem build
|
16
|
+
`gem build sweatshop_gears.gemspec --force`
|
17
17
|
print '.'
|
18
|
-
`gem install
|
18
|
+
`gem install sweatshop_gears-*.gem`
|
19
19
|
puts 'Done.'
|
20
20
|
end
|
21
21
|
|
22
|
-
task :
|
23
|
-
task :
|
22
|
+
task default: :test
|
23
|
+
task test: :build
|
data/bin/sweatshop-gears
CHANGED
@@ -4,7 +4,7 @@ require 'commander/import'
|
|
4
4
|
require 'robot_sweatshop/gears'
|
5
5
|
|
6
6
|
program :name, 'Sweatshop Gears'
|
7
|
-
program :version, '1.0.
|
7
|
+
program :version, '1.0.2'
|
8
8
|
program :description, 'Package management for Robot Sweatshop'
|
9
9
|
program :help, 'Author', 'Justin Scott <jvscott@gmail.com>'
|
10
10
|
|
@@ -14,9 +14,10 @@ command :init do |c|
|
|
14
14
|
c.syntax = 'sweatshop-gears init'
|
15
15
|
c.description = 'Makes the Gears packages available to Robot Sweatshop'
|
16
16
|
c.option '--path STRING', String, 'The working path for downloading packages'
|
17
|
-
c.action do |
|
18
|
-
options.default :
|
17
|
+
c.action do |_args, options|
|
18
|
+
options.default path: '/opt/gears'
|
19
19
|
Gears.download to_path: options.path
|
20
|
+
Gears.create_runtime_paths
|
20
21
|
Gears::Dependencies.install from_path: options.path
|
21
22
|
Gears::Binaries.expose from_path: options.path
|
22
23
|
Gears::Services.load from_path: options.path
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'git'
|
2
2
|
require 'yaml'
|
3
3
|
|
4
|
+
# Provides information and downloading of Gears packages
|
4
5
|
module Gears
|
5
6
|
def self.clone_packages(path)
|
6
7
|
Git.clone git_repo, File.basename(path), path: File.dirname(path)
|
@@ -16,12 +17,19 @@ module Gears
|
|
16
17
|
Announce.success 'Packages downloaded'
|
17
18
|
end
|
18
19
|
|
19
|
-
def self.packages(
|
20
|
-
paths = Dir["#{
|
20
|
+
def self.packages(gears_path)
|
21
|
+
paths = Dir["#{gears_path}/*"].select { |path| File.directory? path }
|
21
22
|
paths.map { |path| File.expand_path path }
|
22
23
|
end
|
23
24
|
|
24
|
-
def self.metadata(
|
25
|
-
YAML.load File.read("#{
|
25
|
+
def self.metadata(package_path)
|
26
|
+
YAML.load File.read("#{package_path}/metadata.yaml")
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.create_runtime_paths
|
30
|
+
config_path = File.expand_path '~/.robot_sweatshop/compiled_config.yaml'
|
31
|
+
config = YAML.load_file config_path
|
32
|
+
FileUtils.mkpath config[:logfile_path]
|
33
|
+
FileUtils.mkpath config[:pidfile_path]
|
26
34
|
end
|
27
35
|
end
|
@@ -2,6 +2,7 @@ require 'fileutils'
|
|
2
2
|
require 'terminal-announce'
|
3
3
|
|
4
4
|
module Gears
|
5
|
+
# Installs binary Gears packages
|
5
6
|
module Binaries
|
6
7
|
def self.expose(from_path:)
|
7
8
|
Gears.packages(from_path).each do |package|
|
@@ -27,9 +28,9 @@ module Gears
|
|
27
28
|
end
|
28
29
|
|
29
30
|
def self.scripts_path
|
30
|
-
|
31
|
-
Announce.failure 'Please run `sweatshop start` again' unless File.
|
32
|
-
config = YAML.load File.read(
|
31
|
+
config = File.expand_path '~/.robot_sweatshop/compiled_config.yaml'
|
32
|
+
Announce.failure 'Please run `sweatshop start` again' unless File.exist? config
|
33
|
+
config = YAML.load File.read(config)
|
33
34
|
config[:scripts_path]
|
34
35
|
end
|
35
36
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'yaml'
|
2
2
|
|
3
3
|
# TODO: config not guaranteed to be there. sweatshop has to run first
|
4
|
-
|
5
|
-
CONFIG = YAML.load_file
|
4
|
+
CONFIG_PATH = File.expand_path '~/.robot_sweatshop/compiled_config.yaml'
|
5
|
+
CONFIG = YAML.load_file CONFIG_PATH
|
6
6
|
PID_PATH = CONFIG[:pidfile_path]
|
7
7
|
LOG_PATH = CONFIG[:logfile_path]
|
8
8
|
|
data/sweatshop_gears.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sweatshop_gears
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Scott
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|