tanjun 0.0.1.alpha2
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 +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +45 -0
- data/Rakefile +2 -0
- data/bin/bootstrap +25 -0
- data/bin/meta +33 -0
- data/bin/project +85 -0
- data/bin/tanjun +88 -0
- data/bin/templates/gitignore +3 -0
- data/bin/templates/tanjun_profile +18 -0
- data/lib/interact/templates/meta/script.rb +14 -0
- data/lib/interact/templates/project/app/views/layout/application.html.haml.tt +15 -0
- data/lib/tanjun/core_ext/open-uri.rb +5 -0
- data/lib/tanjun/generators/base.rb +27 -0
- data/lib/tanjun/generators/bootstrap-sass/install/install_generator.rb +27 -0
- data/lib/tanjun/generators/guard/install/install_generator.rb +13 -0
- data/lib/tanjun/thor_ext/actions.rb +72 -0
- data/lib/tanjun/version.rb +3 -0
- data/lib/tanjun.rb +5 -0
- data/tanjun.gemspec +19 -0
- metadata +83 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Rupert
|
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,45 @@
|
|
1
|
+
# Tanjun
|
2
|
+
|
3
|
+
This gem is an attempt to simplify the Rails development process by automating
|
4
|
+
as many tasks as possible.
|
5
|
+
|
6
|
+
## Automated Install
|
7
|
+
|
8
|
+
You can setup a Tanjun compatible development enviroment using the bootstrap
|
9
|
+
script. This currently only tested with Ubuntu ~> 11.04. It will install the
|
10
|
+
following:
|
11
|
+
|
12
|
+
* Applications: vim google-chrome-stable git
|
13
|
+
* Dependencies: build-essential openssl libreadline6 libreadline6-dev zlib1g
|
14
|
+
zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3
|
15
|
+
libxml2-dev libxslt1-dev autoconf libc6-dev libncurses-dev
|
16
|
+
automake libtool bison subversion
|
17
|
+
* Rubies: 1.9.3
|
18
|
+
* Gems: bundler tanjun rails passenger hub
|
19
|
+
* Directories: ~/projects
|
20
|
+
|
21
|
+
It will also install RVM, make 1.9.3 the default ruby and configure your git
|
22
|
+
repos to work with your Github account. It will also configure your
|
23
|
+
|
24
|
+
### Fresh Install
|
25
|
+
|
26
|
+
. bash -s < <(curl -s https://raw.github.com/ruper654/tanjun/master/bin/bootstrap)
|
27
|
+
|
28
|
+
### With RubyGems
|
29
|
+
|
30
|
+
gem install 'tanjun' && /path/to/gem/directory/tanjun/bin/bootstrap
|
31
|
+
|
32
|
+
## Usage
|
33
|
+
|
34
|
+
### Scripts
|
35
|
+
|
36
|
+
#### Meta
|
37
|
+
|
38
|
+
|
39
|
+
## Contributing
|
40
|
+
|
41
|
+
1. Fork it
|
42
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
43
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
44
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
45
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
data/bin/bootstrap
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# This file can be run directly from Github with:
|
3
|
+
# curl -L http://bit.ly/tanjun-bootstrap | bash -s
|
4
|
+
|
5
|
+
applications="vim google-chrome-stable git"
|
6
|
+
dependencies="build-essential openssl libreadline6 libreadline6-dev "\
|
7
|
+
"zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev "\
|
8
|
+
"sqlite3 libxml2-dev libxslt1-dev autoconf libc6-dev "\
|
9
|
+
"libncurses-dev automake libtool bison subversion"
|
10
|
+
gems="bundler passenger hub rails tanjun"
|
11
|
+
|
12
|
+
# Install package repositories
|
13
|
+
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
|
14
|
+
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
|
15
|
+
sudo apt-get update
|
16
|
+
|
17
|
+
# Install applications and dependencies
|
18
|
+
sudo apt-get install --force-yes --yes $dependencies $applications
|
19
|
+
|
20
|
+
# Install RVM
|
21
|
+
tr_gems=`echo "$gems" | tr ' ' ','`
|
22
|
+
curl -L get.rvm.io | bash -s stable --gems=$tr_gems
|
23
|
+
source "$HOME/.rvm/scripts/rvm"
|
24
|
+
|
25
|
+
tanjun install
|
data/bin/meta
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require_relative 'base'
|
3
|
+
|
4
|
+
module Interact
|
5
|
+
class Meta < Base
|
6
|
+
desc "new NAME [ACTION ..]", "Creates a new thor script"
|
7
|
+
def new(name, *actions)
|
8
|
+
@name = name.underscore
|
9
|
+
@actions = actions
|
10
|
+
if File::exists? @name
|
11
|
+
say "A script called #{@name} already exists"
|
12
|
+
else
|
13
|
+
template "script.rb", @name
|
14
|
+
empty_directory "templates/#{@name}"
|
15
|
+
chmod @name, 0755
|
16
|
+
git add: @name
|
17
|
+
git commit: "-m 'Interact::Meta: Default template for script #{@name}'"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
desc "rename CURRENT_NAME NEW_NAME", "Rename a script"
|
22
|
+
def rename(from, to)
|
23
|
+
from, to = from.underscore, to.underscore
|
24
|
+
|
25
|
+
gsub_file from, from.classify, to.classify
|
26
|
+
git mv: "#{from} #{to}"
|
27
|
+
git mv: "templates/#{from} templates/#{to}"
|
28
|
+
git add: to
|
29
|
+
git commit: "-m 'Meta: Renamed script #{from} to #{to}'"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
Interact::Meta.start
|
data/bin/project
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "gems"
|
3
|
+
require_relative "lib/interact/base"
|
4
|
+
|
5
|
+
module Interact
|
6
|
+
class Project < Base
|
7
|
+
desc "new NAME", "Creates a new project"
|
8
|
+
def new(name)
|
9
|
+
groups = {
|
10
|
+
main: [
|
11
|
+
'rails', 'sqlite3', 'jquery-rails', 'bootstrap-sass', 'simple_form',
|
12
|
+
'haml-rails'
|
13
|
+
],
|
14
|
+
assets: %w(sass-rails coffee-rails therubyracer uglifier)
|
15
|
+
}
|
16
|
+
|
17
|
+
say "The following gems will be installed:\n#{groups}"
|
18
|
+
say "Enter a list of gems to add: "
|
19
|
+
say "Example: rails sqlite3 assets:haml-rails"
|
20
|
+
user_gems = ask "Gems: "
|
21
|
+
groups = user_gems.split(" ").each_with_object(groups) do |str, groups|
|
22
|
+
if str.include(':')
|
23
|
+
str = str.split(':')
|
24
|
+
group, name = str.first.to_sym, str.last
|
25
|
+
else
|
26
|
+
group, name = :main, str
|
27
|
+
end
|
28
|
+
|
29
|
+
groups[group] ||= []
|
30
|
+
groups[group] << gem
|
31
|
+
end
|
32
|
+
|
33
|
+
say "Creating new rails project in ~/projects/#{name}"
|
34
|
+
system("rails new #{name} --skip-bundle")
|
35
|
+
|
36
|
+
inside name do
|
37
|
+
self.destination_root = self.destination_root
|
38
|
+
create_file "Gemfile", "", force: true
|
39
|
+
add_source :rubygems
|
40
|
+
add_gem = ->(name) { gem name.dup, Gems.info(name)['version'] }
|
41
|
+
groups.each do |group, gems|
|
42
|
+
if group == :main
|
43
|
+
gems.each &add_gem
|
44
|
+
else
|
45
|
+
gem_group(group) { gems.each &add_gem }
|
46
|
+
end
|
47
|
+
end
|
48
|
+
system("bundle")
|
49
|
+
|
50
|
+
environment 'config.autoload_paths += Dir["#{config.root}/lib", ' <<
|
51
|
+
'"#{config.root}/lib/**/"]'
|
52
|
+
environment 'config.autoload_paths += ' <<
|
53
|
+
'Dir["../#{config.root}/scripts/lib", "#{config.root}/lib/**/"]',
|
54
|
+
env: :development
|
55
|
+
|
56
|
+
generators = %x[rails generate].split("\n").grep(/:install/)
|
57
|
+
generators.each do |generator|
|
58
|
+
name = generator.split(':').first
|
59
|
+
|
60
|
+
options = case name
|
61
|
+
when "jquery"
|
62
|
+
break
|
63
|
+
when "simple_form"
|
64
|
+
"--bootstrap"
|
65
|
+
else
|
66
|
+
""
|
67
|
+
end
|
68
|
+
|
69
|
+
system("rails g #{generator} #{options}")
|
70
|
+
end
|
71
|
+
|
72
|
+
git :init
|
73
|
+
git :create
|
74
|
+
git add: ".", commit: "-m 'Initial commit'", push: "-u origin master"
|
75
|
+
|
76
|
+
system("rails s")
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
desc "rename", "Renames a project"
|
81
|
+
def rename()
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
Interact::Project.start
|
data/bin/tanjun
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'tanjun'
|
3
|
+
|
4
|
+
module Tanjun
|
5
|
+
class Tanjun < Thor
|
6
|
+
include Thor::Actions
|
7
|
+
|
8
|
+
def self.source_root
|
9
|
+
@source ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
|
10
|
+
end
|
11
|
+
|
12
|
+
desc "install", "installs Tanjun"
|
13
|
+
def install
|
14
|
+
self.destination_root = File.expand_path("~")
|
15
|
+
|
16
|
+
['projects', 'bin'].each do |path|
|
17
|
+
empty_directory path
|
18
|
+
end
|
19
|
+
|
20
|
+
bash_profile = '[[ -s "$HOME/.bashrc" ]] && source "$HOME/.bashrc"'
|
21
|
+
bashrc = '[[ -s "$HOME/.tanjun_profile" ]] && source "$HOME/.tanjun_profile"'
|
22
|
+
bashrc_flag = '[ -z "$PS1" ] && return'
|
23
|
+
|
24
|
+
add_to_file ".bash_profile", bash_profile
|
25
|
+
if add_to_file ".bashrc", bashrc
|
26
|
+
if add_to_file ".bashrc", 'if [[ -n "$PS1" ]]; then', bashrc_flag, force: true, quiet: true
|
27
|
+
add_to_file ".bashrc", 'fi', nil, force: true, quiet: true
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
path = "#{destination_root}/bin/hub"
|
32
|
+
command = "hub hub standalone > #{path} && chmod 755 #{path}"
|
33
|
+
run_with_conflict_check(path, command)
|
34
|
+
|
35
|
+
path = "/opt/nginx/tanjun"
|
36
|
+
command = "rvmsudo passenger-install-nginx-module --auto --auto-download --prefix=#{path}"
|
37
|
+
run_with_conflict_check(path, command)
|
38
|
+
|
39
|
+
path = "/etc/init.d/nginx"
|
40
|
+
command = "sudo curl -L -o /etc/init.d/nginx http://bit.ly/nginx-ubuntu-init-file && sudo chown root:root /etc/init.d/nginx && sudo chmod '/etc/init.d/nginx' 0755 && sudo update-rc.d nginx defaults"
|
41
|
+
run_with_conflict_check(path, command)
|
42
|
+
|
43
|
+
gitconfig = {
|
44
|
+
name: { key: 'user.name', prompt: 'Full Name', value: nil },
|
45
|
+
email: { key: 'user.email', prompt: 'Email Address', value: nil },
|
46
|
+
user: { key: 'github.user', prompt: 'Github Username', value: nil },
|
47
|
+
token: { key: 'github.token', prompt: 'Github Token', value: nil },
|
48
|
+
ignore: { key: 'core.excludesfile', value: '~/.gitignore' },
|
49
|
+
color: { key: 'color.gui', value: 'true' }
|
50
|
+
}
|
51
|
+
|
52
|
+
gitconfig.each do |name, setting|
|
53
|
+
setting[:value] ||= run "git config --global #{setting[:key]}", verbose: false, capture: true
|
54
|
+
if setting[:value].to_s.strip.length == 0
|
55
|
+
while setting[:value].to_s.strip.length == 0
|
56
|
+
setting[:value] = ask "#{setting[:prompt]}: "
|
57
|
+
if setting[:value].to_s.strip.length == 0
|
58
|
+
say "Nothing input. Try again"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
`git config --global #{setting[:key]} #{setting[:value]}`
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
if file_exists?(".ssh/id_rsa") && file_exists?(".ssh/id_rsa.pub")
|
66
|
+
public_key = File.read("#{destination_root}/.ssh/id_rsa.pub")
|
67
|
+
else
|
68
|
+
password, confirm = nil
|
69
|
+
while password != confirm || password.to_s.strip.length <= 4
|
70
|
+
while password.to_s.strip.length == 0
|
71
|
+
password = ask "SSH Passphrase: "
|
72
|
+
if password.to_s.strip.length <= 4
|
73
|
+
say "Password must be longer than 4 characters"
|
74
|
+
end
|
75
|
+
end
|
76
|
+
confirm = ask "Confirm Passphrase: "
|
77
|
+
end
|
78
|
+
|
79
|
+
public_key = run "ssh-keygen -t rsa -C '#{gitconfig[:email][:value]}' -f '#{destination_root}/.ssh/id_rsa' -N #{password}"
|
80
|
+
end
|
81
|
+
|
82
|
+
copy_file 'gitignore', '.gitignore'
|
83
|
+
copy_file 'tanjun_profile', '.tanjun_profile'
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
Tanjun::Tanjun.start
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Warning! Do not edit this file. It will be overwritten if Tanjun bootstrap
|
2
|
+
# is run
|
3
|
+
|
4
|
+
function parse_git_dirty() {
|
5
|
+
[[ $(git status 2> /dev/null | tail -n1) != 'nothing to commit (working directory clean)' ]] && echo '*'
|
6
|
+
}
|
7
|
+
|
8
|
+
function ps1_git() {
|
9
|
+
git branch --no-color 2> /dev/null | sed -e "/^[^*]/d" -e "s/*\(.*\)/\1$(parse_git_dirty)"
|
10
|
+
}
|
11
|
+
|
12
|
+
PS1="\[\033[1;32m\]\u@\h/\j \[\033[1;33m\]\W\[\033[1;34m\]\$(ps1_git)\[\033[00m\]\$ "
|
13
|
+
|
14
|
+
if command -v hub >/dev/null 2>&1; then
|
15
|
+
eval "$(hub alias -s)"
|
16
|
+
fi
|
17
|
+
|
18
|
+
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require_relative "base"
|
3
|
+
|
4
|
+
module Interact
|
5
|
+
class <%= @name.classify %> < Base
|
6
|
+
<%- @actions.each do |action| %>
|
7
|
+
desc "<%= action %>"
|
8
|
+
def <%= action %>()
|
9
|
+
end
|
10
|
+
|
11
|
+
<%- end %>
|
12
|
+
end
|
13
|
+
end
|
14
|
+
Interact::<%= @name.classify %>.start
|
@@ -0,0 +1,15 @@
|
|
1
|
+
!!!
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%title= content_for?(:title) ? yield(:title) : "<%= @app_name %>"
|
5
|
+
= stylesheet_link_tag "application"
|
6
|
+
= javascript_include_tag "application"
|
7
|
+
= csrf_meta_tags
|
8
|
+
|
9
|
+
%body
|
10
|
+
.navbar.navbar-fixed-top
|
11
|
+
.navbar-inner
|
12
|
+
.container
|
13
|
+
|
14
|
+
.container
|
15
|
+
= yield
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'rails/generators/actions'
|
3
|
+
require 'active_support/core_ext/string/inflections'
|
4
|
+
|
5
|
+
module Tanjun
|
6
|
+
class Base < Thor
|
7
|
+
include Thor::Actions
|
8
|
+
include Rails::Generators::Actions
|
9
|
+
|
10
|
+
def self.source_root
|
11
|
+
File.expand_path(File.join(File.dirname(__FILE__), 'templates',
|
12
|
+
script_name))
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.destination_root
|
16
|
+
if script_name == "meta"
|
17
|
+
File.expand_path(File.dirname(__FILE__))
|
18
|
+
else
|
19
|
+
File.expand_path(File.dirname("../#{__FILE}"))
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.script_name
|
24
|
+
name.split("::").last.underscore
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module BootstrapSass
|
4
|
+
module Generators
|
5
|
+
class InstallGenerator < ::Rails::Generators::Base
|
6
|
+
desc "This generator install Twitter Bootstrap to the assets pipeline"
|
7
|
+
|
8
|
+
def add_stylesheets
|
9
|
+
unless File.exists?('app/assets/stylesheets/application.css.scss')
|
10
|
+
create_file('app/assets/stylesheets/application.css.scss')
|
11
|
+
end
|
12
|
+
|
13
|
+
insert_into_file 'app/assets/stylesheets/application.css.scss',
|
14
|
+
%Q{@import "twitter/bootstrap"\n}, before: '@import'
|
15
|
+
end
|
16
|
+
|
17
|
+
def add_javascripts
|
18
|
+
unless File.exists?('app/assets/javascripts/application.js')
|
19
|
+
create_file('app/assets/javascripts/application.js')
|
20
|
+
end
|
21
|
+
|
22
|
+
insert_into_file 'app/assets/javascripts/application.js',
|
23
|
+
%Q{//= require twitter/bootstrap\n}, after: "jquery\n"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
class Thor
|
2
|
+
module Actions
|
3
|
+
def run_with_conflict_check(path, command)
|
4
|
+
path = File.expand_path(path, destination_root)
|
5
|
+
if file_exists? path
|
6
|
+
say_status :conflict, command, :red
|
7
|
+
run_or_skip_or_conflict(options[:force], options[:skip], path, command)
|
8
|
+
else
|
9
|
+
run(command) unless options[:pretend]
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def run_or_skip_or_conflict(force, skip, path, command)
|
14
|
+
if force
|
15
|
+
say_status :force, command, :yellow
|
16
|
+
run(command) unless options[:pretend]
|
17
|
+
elsif skip
|
18
|
+
say_status :skip, command, :yellow
|
19
|
+
else
|
20
|
+
run_or_skip_or_conflict(self.shell.file_collision(path), true, path, command)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def add_to_file(path, content, flag=nil, config={})
|
25
|
+
path = File.expand_path(path, destination_root)
|
26
|
+
content, flag = flag, content unless flag.nil?
|
27
|
+
exists = File.exists? path
|
28
|
+
|
29
|
+
if exists
|
30
|
+
if !grep(path, content)
|
31
|
+
if flag.nil?
|
32
|
+
say("appending #{path}")
|
33
|
+
append_file(path, content, config)
|
34
|
+
else
|
35
|
+
say("replacing #{path}")
|
36
|
+
gsub_file(path, flag, content, config)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
else
|
40
|
+
say "creating #{path}"
|
41
|
+
create_file path, content, config
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def chown(path, user, group, config={})
|
46
|
+
return unless behavior == :invoke
|
47
|
+
path = File.expand_path(path, destination_root)
|
48
|
+
message = "#{user}"
|
49
|
+
message << ":#{group}" if group
|
50
|
+
message << " #{relative_to_original_destination_root(path)}"
|
51
|
+
say_status :chown, message, config.fetch(:verbose, true)
|
52
|
+
FileUtils.chown_R(user, group, path) unless options[:pretend]
|
53
|
+
end
|
54
|
+
|
55
|
+
def grep(path, flag)
|
56
|
+
path = File.expand_path(path, destination_root)
|
57
|
+
open(path).grep(flag) if File.exists? path
|
58
|
+
end
|
59
|
+
|
60
|
+
def file_exists?(path)
|
61
|
+
path = File.expand_path(path, destination_root)
|
62
|
+
File.exists? path
|
63
|
+
end
|
64
|
+
|
65
|
+
def move_file(source, destination)
|
66
|
+
source = File.expand_path source, destination_root
|
67
|
+
destination = File.expand_path destination, destination_root
|
68
|
+
FileUtils.mv source, destination
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
data/lib/tanjun.rb
ADDED
data/tanjun.gemspec
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/tanjun/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Rupert"]
|
6
|
+
gem.email = ["rupert@madden-abbott.com"]
|
7
|
+
gem.description = %q{A collection of tools for faster development}
|
8
|
+
gem.summary = %q{Scripts and generators to speed up your development}
|
9
|
+
gem.homepage = "http://github.com/rupert654/tanjun"
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.executables = %w(tanjun)
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
+
gem.name = "tanjun"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = Tanjun::VERSION
|
17
|
+
|
18
|
+
gem.add_dependency 'thor', '~> 0.14.6'
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tanjun
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1.alpha2
|
5
|
+
prerelease: 6
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Rupert
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-04-14 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: thor
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.14.6
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.14.6
|
30
|
+
description: A collection of tools for faster development
|
31
|
+
email:
|
32
|
+
- rupert@madden-abbott.com
|
33
|
+
executables:
|
34
|
+
- tanjun
|
35
|
+
extensions: []
|
36
|
+
extra_rdoc_files: []
|
37
|
+
files:
|
38
|
+
- .gitignore
|
39
|
+
- Gemfile
|
40
|
+
- LICENSE
|
41
|
+
- README.md
|
42
|
+
- Rakefile
|
43
|
+
- bin/bootstrap
|
44
|
+
- bin/meta
|
45
|
+
- bin/project
|
46
|
+
- bin/tanjun
|
47
|
+
- bin/templates/gitignore
|
48
|
+
- bin/templates/tanjun_profile
|
49
|
+
- lib/interact/templates/meta/script.rb
|
50
|
+
- lib/interact/templates/project/app/views/layout/application.html.haml.tt
|
51
|
+
- lib/tanjun.rb
|
52
|
+
- lib/tanjun/core_ext/open-uri.rb
|
53
|
+
- lib/tanjun/generators/base.rb
|
54
|
+
- lib/tanjun/generators/bootstrap-sass/install/install_generator.rb
|
55
|
+
- lib/tanjun/generators/guard/install/install_generator.rb
|
56
|
+
- lib/tanjun/thor_ext/actions.rb
|
57
|
+
- lib/tanjun/version.rb
|
58
|
+
- tanjun.gemspec
|
59
|
+
homepage: http://github.com/rupert654/tanjun
|
60
|
+
licenses: []
|
61
|
+
post_install_message:
|
62
|
+
rdoc_options: []
|
63
|
+
require_paths:
|
64
|
+
- lib
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ! '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ! '>'
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 1.3.1
|
77
|
+
requirements: []
|
78
|
+
rubyforge_project:
|
79
|
+
rubygems_version: 1.8.21
|
80
|
+
signing_key:
|
81
|
+
specification_version: 3
|
82
|
+
summary: Scripts and generators to speed up your development
|
83
|
+
test_files: []
|