bootlace 0.1.6 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Bootlace
2
2
 
3
- A simple gem for bootstrapping Ruby applications based upon the GitHub script/bootstrap model, but with a tiny DSL on top.
3
+ A simple gem for getting your development (or other) environments setup quickly! Efficiently bootstrap Ruby applications based upon the GitHub script/bootstrap model, but with a clean DSL on top.
4
4
 
5
5
  Right now it's very lightweight, and the DSL is expected to change as we use it on more projects and find we need to revise
6
6
  how we're doing things.
@@ -29,13 +29,12 @@ Create a `script/bootstrap` file in your app that looks like so:
29
29
  #!/bin/env ruby
30
30
 
31
31
  require 'bootlace'
32
- include Bootlace
33
32
 
34
- package mac: "redis", ubuntu: "redis-server"
35
-
36
- bundler
37
-
38
- rake 'db:create', environment: { "RAILS_ENV" => "test" }
33
+ Bootlace.strap_up do |b|
34
+ b.package mac: "redis", ubuntu: "redis-server"
35
+ b.bundler
36
+ b.rake 'db:create', environment: { RAILS_ENV: "test" }
37
+ end
39
38
  ```
40
39
 
41
40
  ## Contributing
data/lib/bootlace/rake.rb CHANGED
@@ -10,7 +10,7 @@ module Bootlace
10
10
  }.merge(o)
11
11
 
12
12
  options[:environment].each do |key,val|
13
- ENV[key] = val
13
+ ENV[key.to_s] = val.to_s
14
14
  end
15
15
 
16
16
  logger.info("Executing rake task '#{task}'")
@@ -1,3 +1,3 @@
1
1
  module Bootlace
2
- VERSION = "0.1.6"
2
+ VERSION = "0.2.1"
3
3
  end
data/lib/bootlace.rb CHANGED
@@ -6,9 +6,19 @@ require "bootlace/rake"
6
6
  require "bootlace/bundler"
7
7
 
8
8
  module Bootlace
9
- include Bootlace::OS
10
- include Bootlace::Logger
11
- include Bootlace::Package
12
- include Bootlace::Rake
13
- include Bootlace::Bundler
9
+ class Base
10
+ include Bootlace::OS
11
+ include Bootlace::Logger
12
+ include Bootlace::Package
13
+ include Bootlace::Rake
14
+ include Bootlace::Bundler
15
+ end
16
+
17
+ def self.base
18
+ @base ||= Bootlace::Base.new
19
+ end
20
+
21
+ def self.strap_up
22
+ yield base if block_given?
23
+ end
14
24
  end
@@ -33,4 +33,10 @@ class RakeTest < Test::Unit::TestCase
33
33
  bootstrap.rake "foo:bar:baz", environment: { "SOMEOPT" => "SET" }
34
34
  assert_equal "SET", ENV['SOMEOPT']
35
35
  end
36
+
37
+ def test_sets_symbolized_env_variables
38
+ bootstrap.stubs(:system).returns(0)
39
+ bootstrap.rake "foo:bar:baz", environment: { SOMEOPT: "SET" }
40
+ assert_equal "SET", ENV['SOMEOPT']
41
+ end
36
42
  end
@@ -1,24 +1,12 @@
1
1
  require File.expand_path("../../lib/bootlace", __FILE__)
2
2
  require_relative 'test_helper.rb'
3
3
 
4
- class Bootstrap
5
- include Bootlace
6
- end
7
-
8
4
  class BootlaceTest < Test::Unit::TestCase
9
5
  include TestHelpers
10
6
 
11
- attr_accessor :bootstrap
12
-
13
- def setup
14
- @bootstrap = Bootstrap.new
15
- end
16
-
17
7
  def test_reality
18
- bootstrap.stubs(:system).returns(0)
19
- bootstrap.bundler
20
- bootstrap.rake 'foo'
21
- bootstrap.package 'bar'
22
- true
8
+ Bootlace.strap_up do |b|
9
+ assert_equal b, Bootlace.base
10
+ end
23
11
  end
24
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootlace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-20 00:00:00.000000000 Z
12
+ date: 2012-04-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mocha
16
- requirement: &70229665837960 !ruby/object:Gem::Requirement
16
+ requirement: &70254552220420 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70229665837960
24
+ version_requirements: *70254552220420
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activesupport
27
- requirement: &70229665836580 !ruby/object:Gem::Requirement
27
+ requirement: &70254552219760 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70229665836580
35
+ version_requirements: *70254552219760
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: turn
38
- requirement: &70229665835020 !ruby/object:Gem::Requirement
38
+ requirement: &70254552219140 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70229665835020
46
+ version_requirements: *70254552219140
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: pry
49
- requirement: &70229665976540 !ruby/object:Gem::Requirement
49
+ requirement: &70254552218520 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70229665976540
57
+ version_requirements: *70254552218520
58
58
  description: Simple gem for bootstrapping Ruby applications
59
59
  email:
60
60
  - will@highgroove.com
@@ -93,18 +93,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
93
93
  - - ! '>='
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
- segments:
97
- - 0
98
- hash: -1560755192255842632
99
96
  required_rubygems_version: !ruby/object:Gem::Requirement
100
97
  none: false
101
98
  requirements:
102
99
  - - ! '>='
103
100
  - !ruby/object:Gem::Version
104
101
  version: '0'
105
- segments:
106
- - 0
107
- hash: -1560755192255842632
108
102
  requirements: []
109
103
  rubyforge_project:
110
104
  rubygems_version: 1.8.16