bullseye 0.0.2 → 0.0.3

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.
data/Gemfile CHANGED
@@ -1,4 +1,8 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in bullseye.gemspec
1
+ # generated by penchant, environment: remote
2
+ source "https://rubygems.org"
4
3
  gemspec
4
+ gem "rake"
5
+ gem "capybara"
6
+ gem "cucumber"
7
+ gem "rspec"
8
+ gem "cuke-pack", {:git=>"git://github.com/johnbintz/cuke-pack.git"}
@@ -0,0 +1,25 @@
1
+ # ensure git hooks are always installed
2
+ ensure_git_hooks!
3
+
4
+ # everything in the :local env is assumed to be a sibling directory of this one
5
+ defaults_for env(:local), :path => '../%s'
6
+
7
+ # reference a github repository with gem 'my-gem', :github => 'username'
8
+ property :github, :git => 'git://github.com/$1/%s.git'
9
+ source 'https://rubygems.org'
10
+
11
+ # Specify your gem's dependencies in bullseye.gemspec
12
+ gemspec
13
+
14
+ gem 'rake'
15
+
16
+ gems 'capybara', 'cucumber', 'rspec'
17
+
18
+ env :local do
19
+ gem 'cuke-pack'
20
+ end
21
+
22
+ env :remote do
23
+ gem 'cuke-pack', :github => 'johnbintz'
24
+ end
25
+
data/README.md CHANGED
@@ -60,3 +60,9 @@ Want to target that page in your Sass? Use a little string interpolation and a f
60
60
  ```
61
61
 
62
62
  Piece of cake.
63
+
64
+ ## Hacking
65
+
66
+ _You'll need to install [Penchant](http://github.com/johnbintz/penchant) to mess with the Gemfile
67
+ during development._
68
+
data/Rakefile CHANGED
@@ -1,2 +1,3 @@
1
1
  #!/usr/bin/env rake
2
2
  require "bundler/gem_tasks"
3
+
@@ -2,11 +2,12 @@
2
2
 
3
3
  this.Bullseye = {
4
4
  target: function(controller, action, callback) {
5
- this.targets = (this.targets || {});
6
5
  this.targets[controller] = (this.targets[controller] || {});
7
6
  this.targets[controller][action] = callback;
8
7
  },
9
8
 
9
+ targets: {},
10
+
10
11
  exec: function(controller, action) {
11
12
  if (this.targets[controller] && this.targets[controller][action]) {
12
13
  this.targets[controller][action].apply(this.context);
@@ -17,8 +18,5 @@ this.Bullseye = {
17
18
  Bullseye.context = this;
18
19
 
19
20
  $(function() {
20
- var controller = $('body').data('controller');
21
- var action = $('body').data('action');
22
-
23
- Bullseye.exec(controller, action);
21
+ Bullseye.exec($('body').data('controller'), $('body').data('action'));
24
22
  });
@@ -1,3 +1,3 @@
1
1
  module Bullseye
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'penchant'
5
+
6
+ if Penchant::Gemfile.do_full_env_switch!(ARGV[0])
7
+ puts "Gemfile switched to #{ARGV[0]}"
8
+ else
9
+ exit 0
10
+ end
11
+
@@ -0,0 +1,40 @@
1
+ #!/bin/bash
2
+
3
+ msg=$(cat $1)
4
+
5
+ OLD_GIT_DIR=$GIT_DIR
6
+
7
+ # lion appears to insert git paths before everything else. ensure rvm can
8
+ # bust through, at the very least.
9
+ if [ ! -z "$MY_RUBY_HOME" ]; then
10
+ PATH="$MY_RUBY_HOME/bin:$PATH"
11
+ fi
12
+
13
+ if [ ! -z "$GEM_PATH" ]; then
14
+ oifs="$IFS"
15
+ while IFS=":" read -ra GEM_PATHS; do
16
+ FIXED_GEM_PATH=""
17
+ for i in "${GEM_PATHS[@]}"; do
18
+ FIXED_GEM_PATH="$FIXED_GEM_PATH:${i}/bin"
19
+ done
20
+ done <<< "$GEM_PATH"
21
+ IFS="$oifs"
22
+ PATH="$FIXED_GEM_PATH:$PATH"
23
+ fi
24
+
25
+ if [[ "${msg}" != *"[ci skip]"* ]]; then
26
+ if [ "$(penchant gemfile-env)" != "remote" ]; then
27
+ unset GIT_DIR
28
+ penchant gemfile remote
29
+ GIT_DIR=$OLD_GIT_DIR
30
+ fi
31
+
32
+ if [ $(bundle exec rake -P | grep default | wc -l) -ne 0 ]; then
33
+ bundle exec rake
34
+ R=$?
35
+ if [ $R -ne 0 ]; then exit $R; fi
36
+ else
37
+ echo "[penchant] No default Rake task found! Add one if you want to run tests before committing."
38
+ fi
39
+ fi
40
+
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+
3
+ unset GIT_DIR
4
+ penchant gemfile remote --switch-back
5
+
@@ -0,0 +1,14 @@
1
+ #!/bin/bash
2
+
3
+ if [ $(bundle exec rake -P | grep preflight_check | wc -l) -ne 0 ]; then
4
+ bundle exec rake preflight_check
5
+ R=$?
6
+ if [ $R -ne 0 ]; then exit $R; fi
7
+ fi
8
+
9
+ unset GIT_DIR
10
+ penchant gemfile remote --deployment
11
+ GIT_DIR=$OLD_GIT_DIR
12
+ git add Gemfile*
13
+
14
+ exit 0
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ if File.file?('Gemfile.erb')
4
+ pwd = Dir.pwd
5
+
6
+ Dir.chdir '..' do
7
+ File.readlines(File.join(pwd, 'Gemfile.erb')).find_all { |line| line[':git'] }.each do |line|
8
+ repo = line[%r{:git => (['"])([^'"]+)\1}, 2]
9
+
10
+ puts "Installing #{repo}"
11
+ system %{git clone #{repo}}
12
+ end
13
+ end
14
+
15
+ puts "Bundling for local environment"
16
+ system %{script/gemfile local}
17
+ else
18
+ puts "Bundling..."
19
+ system %{bundle}
20
+ end
21
+
22
+ puts "Installing git hooks"
23
+ system %{script/install-git-hooks}
24
+
25
+ bundle = File.file?('Gemfile') ? 'bundle exec' : ''
26
+
27
+ command = [ bundle, 'rake', '-s', '-T', 'bootstrap' ]
28
+
29
+ if !(%x{#{command.join(' ')}}).empty?
30
+ puts "Trying to run rake bootstrap..."
31
+ system %{#{bundle} rake bootstrap}
32
+ end
33
+
34
+ puts "Done!"
35
+
@@ -0,0 +1,6 @@
1
+ #!/bin/bash
2
+
3
+ for hook in script/hooks/* ; do
4
+ ln -sf $PWD/$hook .git/hooks/${hook##*/}
5
+ done
6
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullseye
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-23 00:00:00.000000000 Z
12
+ date: 2012-08-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: tilt
@@ -68,6 +68,7 @@ extra_rdoc_files: []
68
68
  files:
69
69
  - .gitignore
70
70
  - Gemfile
71
+ - Gemfile.penchant
71
72
  - LICENSE
72
73
  - README.md
73
74
  - Rakefile
@@ -80,6 +81,12 @@ files:
80
81
  - lib/bullseye/tilt/bullseye_template.rb
81
82
  - lib/bullseye/tilt/find_parts.rb
82
83
  - lib/bullseye/version.rb
84
+ - script/gemfile
85
+ - script/hooks/commit-msg
86
+ - script/hooks/post-commit
87
+ - script/hooks/pre-commit
88
+ - script/initialize-environment
89
+ - script/install-git-hooks
83
90
  homepage: ''
84
91
  licenses: []
85
92
  post_install_message:
@@ -92,12 +99,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
92
99
  - - ! '>='
93
100
  - !ruby/object:Gem::Version
94
101
  version: '0'
102
+ segments:
103
+ - 0
104
+ hash: 2003828615834542640
95
105
  required_rubygems_version: !ruby/object:Gem::Requirement
96
106
  none: false
97
107
  requirements:
98
108
  - - ! '>='
99
109
  - !ruby/object:Gem::Version
100
110
  version: '0'
111
+ segments:
112
+ - 0
113
+ hash: 2003828615834542640
101
114
  requirements: []
102
115
  rubyforge_project:
103
116
  rubygems_version: 1.8.23