carb 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/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ coverage
6
+ InstalledFiles
7
+ lib/bundler/man
8
+ pkg
9
+ rdoc
10
+ spec/reports
11
+ test/tmp
12
+ test/version_tmp
13
+ tmp
14
+ Gemfile.lock
15
+
16
+ # YARD artifacts
17
+ .yardoc
18
+ _yardoc
19
+ doc/
20
+
21
+ .DS_Store
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in octaplus.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Jeroen Bourgois
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # Carb
2
+
3
+ Tool to help us set up our web apps faster. It can merge different subprojects
4
+ and deliver a folder ready to start developing.
5
+
6
+ Available setups are:
7
+
8
+ - on-fire: [octaplus](https://github.com/proximitybbdo/octaplus) topped with [bearded-octo](https://github.com/proximitybbdo/bearded-octo) and [moreorless](https://github.com/rob-bar/moreorless) (default)
9
+ - octaplus: octaplus installation
10
+ - bearded-octo: frontend framework topped with moreorless
11
+
12
+ ## Installation
13
+
14
+ Add this line to your application's Gemfile:
15
+
16
+ gem 'carb'
17
+
18
+ And then execute:
19
+
20
+ $ bundle
21
+
22
+ Or install it yourself as:
23
+
24
+ $ gem install carb
25
+
26
+ ## Usage
27
+
28
+ To install a specific type, just run the command
29
+
30
+ $ carb create TYPE TARGET_FOLDER
31
+
32
+ The possible types are
33
+
34
+ - on-fire: octaplus topped with bearded-octo and moreorless (default)
35
+ - octaplus: a fuelphp installation
36
+ - bearded-octo: frontend framework topped with moreorless
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
data/bin/carb ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- encoding : utf-8 -*-
3
+
4
+ $:.unshift File.dirname(__FILE__) + '/../lib'
5
+
6
+ require 'rubygems'
7
+ require 'trollop'
8
+ require 'carb'
9
+
10
+ Carb::CLI.start
data/carb.gemspec ADDED
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/carb/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Jeroen Bourgois"]
6
+ gem.email = ["jeroenbourgois@gmail.com"]
7
+ gem.description = %q{Boost the start of a Proximity BBDO Octaplus framework}
8
+ gem.summary = %q{Boost the start of a Proximity BBDO Octaplus framework}
9
+ gem.homepage = ""
10
+
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+ gem.name = "carb"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = Carb::VERSION
17
+
18
+ gem.add_dependency "trollop"
19
+ gem.add_dependency "colored"
20
+ gem.add_dependency "fileutils"
21
+ end
data/lib/carb/cli.rb ADDED
@@ -0,0 +1,57 @@
1
+ require 'carb'
2
+
3
+ module Carb
4
+ class CLI
5
+ class << self
6
+ SUB_COMMANDS = %w(create)
7
+
8
+ def start
9
+ puts 'TODO: implement the target param'.black.reversed
10
+ puts 'TODO: alter the default view, merge with index.html'.black.reversed
11
+ puts 'TODO: add check if target exists'.black.reversed
12
+ puts 'TODO: use FileUtils as much as possible'.black.reversed
13
+ puts 'TODO: check if repos are there'.black.reversed
14
+ global_opts = Trollop::options do
15
+ version = "Carb v#{Carb::VERSION}"
16
+ banner <<-EOS
17
+ #{version}
18
+
19
+ Carb gets your fuel flowing. Use it to setup your web dev env.
20
+
21
+ Usage:
22
+ carb create <type> <folder>
23
+
24
+ Where <type> is one of:
25
+ octaplus our fuelphp framework, this is as bare as it gets
26
+ bearded-octo our frontend framework together with moreoreless for less/css
27
+ on-fire octaplus + bearded-octo = dev on fire!
28
+
29
+ EOS
30
+
31
+ # raise Trollop::HelpNeeded if ARGV.empty? # show help screen
32
+ stop_on SUB_COMMANDS
33
+ end
34
+
35
+ cmd = ARGV.shift # get the subcommand
36
+ cmd_opts = case cmd
37
+ when "create" # parse create options
38
+ Trollop::options do
39
+ type = ARGV.shift
40
+ target = ARGV.shift || "."
41
+
42
+ if Carb::PROJECT_TYPES.include?(type)
43
+ Carb::Controller.assemble(type, target)
44
+ else
45
+ Trollop::die "wrong type passed. Use one these options: [#{Carb::PROJECT_TYPES.join(' | ')}]."
46
+ end
47
+ end
48
+ when nil
49
+ Trollop::die "No command specified! Please specify an applicable command"
50
+ else
51
+ Trollop::die "Unknown command #{cmd.inspect}"
52
+ end
53
+
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,9 @@
1
+ module Carb
2
+ TYPE_OCTAPLUS = 'octaplus'
3
+ TYPE_BEARDED_OCTO = 'bearded-octo'
4
+ TYPE_ON_FIRE = 'on-fire'
5
+
6
+ PROJECT_TYPES = [TYPE_OCTAPLUS, TYPE_BEARDED_OCTO, TYPE_ON_FIRE]
7
+
8
+ TMP_FOLDER = "/tmp/proxdev"
9
+ end
@@ -0,0 +1,124 @@
1
+ # -*- encoding : utf-8 -*-
2
+ require 'carb'
3
+
4
+ module Carb
5
+ class Controller
6
+ class << self
7
+
8
+ type, pwd, target = '', '', ''
9
+
10
+ ##################################
11
+ # the chef
12
+ ##################################
13
+
14
+ def assemble(type, target)
15
+ @type = type
16
+ @target = target || "."
17
+
18
+ set_up()
19
+
20
+ case @type
21
+ when Carb::TYPE_OCTAPLUS
22
+ cook_octaplus()
23
+ when Carb::TYPE_BEARDED_OCTO
24
+ cook_bearded_octo()
25
+ when Carb::TYPE_ON_FIRE
26
+ cook_on_fire()
27
+ end
28
+
29
+ tear_down()
30
+ end
31
+
32
+ def set_up
33
+ puts "⚡ Preparing your package, hold on ⚡".blue
34
+
35
+ # save pwd
36
+ @pwd = Dir.pwd
37
+
38
+ # remove previous
39
+ %x[rm -rf #{Carb::TMP_FOLDER}]
40
+
41
+ # FileUtils.rm_rf = "#{TMP_FOLDER}"
42
+
43
+ # create tmp folder
44
+ %x[mkdir -p #{Carb::TMP_FOLDER}]
45
+
46
+ # create some collecting folders
47
+ #
48
+ # TODO these subfolder names should be the same as the PROJECT_TYPES
49
+ # used by the CLI app. Maybe create a Config class with static members ?
50
+ # Or how can you handle config files in ruby?
51
+ #
52
+ # %x[mkdir -p #{TMP_FOLDER}/octaplus #{TMP_FOLDER}/bearded #{TMP_FOLDER}/boilerplate]
53
+
54
+ # and move to the root of them
55
+ Dir.chdir "#{Carb::TMP_FOLDER}"
56
+ end
57
+
58
+ def tear_down
59
+ # copy the bundle to the current working directory
60
+ puts "", "⚡⚡⚡ Et voila! All set in the ./#{@target} folder ⚡⚡⚡ ".green.reversed
61
+ puts ""
62
+
63
+ %x[mkdir -p #{@pwd}/#{@target} | cp -R boilerplate/ #{@pwd}/#{@target}]
64
+
65
+ # clean up
66
+ # %x[rm -rf #{TMP_FOLDER}]
67
+ end
68
+
69
+ ##################################
70
+ # the ingredients
71
+ ##################################
72
+
73
+ def get_octaplus
74
+ puts ' ⚡ A bit of Octaplus goodness'
75
+ %x[mkdir -p octaplus]
76
+ %x[curl -L -s https://github.com/proximitybbdo/octaplus/tarball/master | tar xz --strip 1 -C octaplus]
77
+ end
78
+
79
+ def get_bearded_octo
80
+ puts ' ⚡ Some bearded-octo seasoning'
81
+ %x[mkdir -p bearded]
82
+ %x[curl -L -s https://github.com/proximitybbdo/bearded-octo/tarball/master | tar xz --strip 1 -C bearded]
83
+ end
84
+
85
+ def get_moreorless
86
+ puts ' ⚡ A dash of moreorless'
87
+ %x[mkdir -p moreorless]
88
+ %x[curl -L -s https://github.com/rob-bar/moreorless/tarball/master | tar xz --strip 1 -C moreorless]
89
+ end
90
+
91
+ ##################################
92
+ # cook the recipes
93
+ ##################################
94
+
95
+ def cook_octaplus
96
+ get_octaplus()
97
+
98
+ %x[cp -R octaplus/ boilerplate]
99
+ end
100
+
101
+ def cook_bearded_octo
102
+ get_bearded_octo()
103
+ get_moreorless()
104
+
105
+ %x[rm -rf boilerplate/assets/*]
106
+ %x[mkdir -p boilerplate/assets]
107
+ %x[cp -R bearded/assets/ boilerplate/assets]
108
+ %x[rm -rf moreorless/tests]
109
+ %x[cp -R moreorless/ boilerplate/assets/css]
110
+ end
111
+
112
+ def cook_on_fire
113
+ get_octaplus()
114
+ cook_bearded_octo()
115
+
116
+ %x[cp -R octaplus/ boilerplate]
117
+ %x[cp bearded/index.html boilerplate/fuel/app/views/welcome]
118
+
119
+ # actions on the views
120
+ end
121
+
122
+ end
123
+ end
124
+ end
@@ -0,0 +1,3 @@
1
+ module Carb
2
+ VERSION = "0.0.3"
3
+ end
data/lib/carb.rb ADDED
@@ -0,0 +1,11 @@
1
+ require 'rubygems'
2
+ require 'colored'
3
+ require 'fileutils'
4
+
5
+ require 'carb/version'
6
+ require 'carb/config'
7
+ require 'carb/cli'
8
+ require 'carb/controller'
9
+
10
+ module Carb
11
+ end
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: carb
3
+ version: !ruby/object:Gem::Version
4
+ hash: 25
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 3
10
+ version: 0.0.3
11
+ platform: ruby
12
+ authors:
13
+ - Jeroen Bourgois
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2012-10-03 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: trollop
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
31
+ version: "0"
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: colored
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ hash: 3
43
+ segments:
44
+ - 0
45
+ version: "0"
46
+ type: :runtime
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: fileutils
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ hash: 3
57
+ segments:
58
+ - 0
59
+ version: "0"
60
+ type: :runtime
61
+ version_requirements: *id003
62
+ description: Boost the start of a Proximity BBDO Octaplus framework
63
+ email:
64
+ - jeroenbourgois@gmail.com
65
+ executables:
66
+ - carb
67
+ extensions: []
68
+
69
+ extra_rdoc_files: []
70
+
71
+ files:
72
+ - .gitignore
73
+ - Gemfile
74
+ - LICENSE
75
+ - README.md
76
+ - Rakefile
77
+ - bin/carb
78
+ - carb.gemspec
79
+ - lib/carb.rb
80
+ - lib/carb/cli.rb
81
+ - lib/carb/config.rb
82
+ - lib/carb/controller.rb
83
+ - lib/carb/version.rb
84
+ homepage: ""
85
+ licenses: []
86
+
87
+ post_install_message:
88
+ rdoc_options: []
89
+
90
+ require_paths:
91
+ - lib
92
+ required_ruby_version: !ruby/object:Gem::Requirement
93
+ none: false
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ hash: 3
98
+ segments:
99
+ - 0
100
+ version: "0"
101
+ required_rubygems_version: !ruby/object:Gem::Requirement
102
+ none: false
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ hash: 3
107
+ segments:
108
+ - 0
109
+ version: "0"
110
+ requirements: []
111
+
112
+ rubyforge_project:
113
+ rubygems_version: 1.8.24
114
+ signing_key:
115
+ specification_version: 3
116
+ summary: Boost the start of a Proximity BBDO Octaplus framework
117
+ test_files: []
118
+