flx-tools 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +99 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +20 -0
- data/Rakefile +48 -0
- data/VERSION +1 -0
- data/lib/flx-tools.rb +0 -0
- data/lib/generators/flux_flex/install_generator.rb +47 -0
- data/lib/generators/flux_flex/templates/.flx +22 -0
- data/lib/generators/flux_flex/templates/.htaccess +7 -0
- data/lib/generators/flux_flex/templates/fluxflex_deploy.sh +7 -0
- data/lib/generators/flux_flex/templates/fluxflex_rake.sh +5 -0
- data/lib/generators/flux_flex/templates/fluxflex_setup.sh +9 -0
- data/lib/generators/flux_flex/templates/flx_dispatch.fcgi +35 -0
- data/spec/flx-tools_spec.rb +7 -0
- data/spec/spec_helper.rb +12 -0
- metadata +153 -0
data/.document
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
abstract (1.0.0)
|
5
|
+
actionmailer (3.0.9)
|
6
|
+
actionpack (= 3.0.9)
|
7
|
+
mail (~> 2.2.19)
|
8
|
+
actionpack (3.0.9)
|
9
|
+
activemodel (= 3.0.9)
|
10
|
+
activesupport (= 3.0.9)
|
11
|
+
builder (~> 2.1.2)
|
12
|
+
erubis (~> 2.6.6)
|
13
|
+
i18n (~> 0.5.0)
|
14
|
+
rack (~> 1.2.1)
|
15
|
+
rack-mount (~> 0.6.14)
|
16
|
+
rack-test (~> 0.5.7)
|
17
|
+
tzinfo (~> 0.3.23)
|
18
|
+
activemodel (3.0.9)
|
19
|
+
activesupport (= 3.0.9)
|
20
|
+
builder (~> 2.1.2)
|
21
|
+
i18n (~> 0.5.0)
|
22
|
+
activerecord (3.0.9)
|
23
|
+
activemodel (= 3.0.9)
|
24
|
+
activesupport (= 3.0.9)
|
25
|
+
arel (~> 2.0.10)
|
26
|
+
tzinfo (~> 0.3.23)
|
27
|
+
activeresource (3.0.9)
|
28
|
+
activemodel (= 3.0.9)
|
29
|
+
activesupport (= 3.0.9)
|
30
|
+
activesupport (3.0.9)
|
31
|
+
arel (2.0.10)
|
32
|
+
builder (2.1.2)
|
33
|
+
diff-lcs (1.1.2)
|
34
|
+
erubis (2.6.6)
|
35
|
+
abstract (>= 1.0.0)
|
36
|
+
git (1.2.5)
|
37
|
+
i18n (0.5.0)
|
38
|
+
jeweler (1.6.4)
|
39
|
+
bundler (~> 1.0)
|
40
|
+
git (>= 1.2.5)
|
41
|
+
rake
|
42
|
+
mail (2.2.19)
|
43
|
+
activesupport (>= 2.3.6)
|
44
|
+
i18n (>= 0.4.0)
|
45
|
+
mime-types (~> 1.16)
|
46
|
+
treetop (~> 1.4.8)
|
47
|
+
mime-types (1.16)
|
48
|
+
polyglot (0.3.1)
|
49
|
+
rack (1.2.3)
|
50
|
+
rack-mount (0.6.14)
|
51
|
+
rack (>= 1.0.0)
|
52
|
+
rack-test (0.5.7)
|
53
|
+
rack (>= 1.0)
|
54
|
+
rails (3.0.9)
|
55
|
+
actionmailer (= 3.0.9)
|
56
|
+
actionpack (= 3.0.9)
|
57
|
+
activerecord (= 3.0.9)
|
58
|
+
activeresource (= 3.0.9)
|
59
|
+
activesupport (= 3.0.9)
|
60
|
+
bundler (~> 1.0)
|
61
|
+
railties (= 3.0.9)
|
62
|
+
railties (3.0.9)
|
63
|
+
actionpack (= 3.0.9)
|
64
|
+
activesupport (= 3.0.9)
|
65
|
+
rake (>= 0.8.7)
|
66
|
+
rdoc (~> 3.4)
|
67
|
+
thor (~> 0.14.4)
|
68
|
+
rake (0.8.7)
|
69
|
+
rcov (0.9.9)
|
70
|
+
rdoc (3.8)
|
71
|
+
rspec (2.3.0)
|
72
|
+
rspec-core (~> 2.3.0)
|
73
|
+
rspec-expectations (~> 2.3.0)
|
74
|
+
rspec-mocks (~> 2.3.0)
|
75
|
+
rspec-core (2.3.1)
|
76
|
+
rspec-expectations (2.3.0)
|
77
|
+
diff-lcs (~> 1.1.2)
|
78
|
+
rspec-mocks (2.3.0)
|
79
|
+
rspec-rails (2.3.1)
|
80
|
+
actionpack (~> 3.0)
|
81
|
+
activesupport (~> 3.0)
|
82
|
+
railties (~> 3.0)
|
83
|
+
rspec (~> 2.3.0)
|
84
|
+
thor (0.14.6)
|
85
|
+
treetop (1.4.9)
|
86
|
+
polyglot (>= 0.3.1)
|
87
|
+
tzinfo (0.3.29)
|
88
|
+
|
89
|
+
PLATFORMS
|
90
|
+
ruby
|
91
|
+
|
92
|
+
DEPENDENCIES
|
93
|
+
bundler (~> 1.0.0)
|
94
|
+
jeweler (~> 1.6.4)
|
95
|
+
rails
|
96
|
+
rake (= 0.8.7)
|
97
|
+
rcov
|
98
|
+
rspec (~> 2.3.0)
|
99
|
+
rspec-rails
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Yamada Masaki
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
= flx-tools
|
2
|
+
Enable to deploy your rails application to fluxflex.com
|
3
|
+
|
4
|
+
rails g flux_flex:install
|
5
|
+
|
6
|
+
== Contributing to flx-tools
|
7
|
+
|
8
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
9
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
10
|
+
* Fork the project
|
11
|
+
* Start a feature/bugfix branch
|
12
|
+
* Commit and push until you are happy with your contribution
|
13
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
14
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
15
|
+
|
16
|
+
== Copyright
|
17
|
+
|
18
|
+
Copyright (c) 2011 Yamada Masaki. See LICENSE.txt for
|
19
|
+
further details.
|
20
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "flx-tools"
|
18
|
+
gem.homepage = "http://github.com/masarakki/flx-tools"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{Install files to deploy on fluxflex.com}
|
21
|
+
gem.description = %Q{Install files to deploy on fluxflex.com}
|
22
|
+
gem.email = "masaki@hisme.net"
|
23
|
+
gem.authors = ["masarakki"]
|
24
|
+
end
|
25
|
+
Jeweler::RubygemsDotOrgTasks.new
|
26
|
+
|
27
|
+
require 'rspec/core'
|
28
|
+
require 'rspec/core/rake_task'
|
29
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
30
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
31
|
+
end
|
32
|
+
|
33
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
34
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
35
|
+
spec.rcov = true
|
36
|
+
end
|
37
|
+
|
38
|
+
task :default => :spec
|
39
|
+
|
40
|
+
require 'rake/rdoctask'
|
41
|
+
Rake::RDocTask.new do |rdoc|
|
42
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
43
|
+
|
44
|
+
rdoc.rdoc_dir = 'rdoc'
|
45
|
+
rdoc.title = "flx-tools #{version}"
|
46
|
+
rdoc.rdoc_files.include('README*')
|
47
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
48
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
data/lib/flx-tools.rb
ADDED
File without changes
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'rails/generators/base'
|
2
|
+
|
3
|
+
module FluxFlex
|
4
|
+
module Generators
|
5
|
+
class InstallGenerator < Rails::Generators::Base
|
6
|
+
desc <<DESC
|
7
|
+
Description:
|
8
|
+
Add files to deploy for fluxflex
|
9
|
+
DESC
|
10
|
+
def self.source_root
|
11
|
+
@_flx_tools_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
|
12
|
+
end
|
13
|
+
|
14
|
+
def copy_dot_flx
|
15
|
+
template '.flx'
|
16
|
+
end
|
17
|
+
|
18
|
+
def copy_sh_files
|
19
|
+
template 'fluxflex_deploy.sh'
|
20
|
+
template 'fluxflex_rake.sh'
|
21
|
+
template 'fluxflex_setup.sh'
|
22
|
+
end
|
23
|
+
|
24
|
+
def copy_dispatch_fcgi
|
25
|
+
template 'flx_dispatch.fcgi', File.join('public', 'flx_dispatch.fcgi')
|
26
|
+
end
|
27
|
+
|
28
|
+
def copy_dot_htaccess
|
29
|
+
template '.htaccess', File.join('public', '.htaccess')
|
30
|
+
end
|
31
|
+
|
32
|
+
def insert_gems
|
33
|
+
gemfile = 'Gemfile'
|
34
|
+
if File.exists?(gemfile)
|
35
|
+
body = File.read(gemfile)
|
36
|
+
File.open(gemfile, 'a') do |f|
|
37
|
+
f.puts "gem 'mysql2'" unless body.match(/mysql/)
|
38
|
+
f.puts "gem 'fcgi'" unless body.match(/fcgi/)
|
39
|
+
end
|
40
|
+
else
|
41
|
+
raise Rails::Generators::Error, "First, you must setup rspec by 'rails generate rspec:install'"
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
[setup]
|
2
|
+
ln -s public public_html
|
3
|
+
mv public/flx_dispatch.fcgi public/dispatch.fcgi
|
4
|
+
chmod 705 public/dispatch.fcgi
|
5
|
+
mkdir log
|
6
|
+
touch log/production.log
|
7
|
+
chmod 606 log/production.log
|
8
|
+
chmod 707 ./log
|
9
|
+
|
10
|
+
[replace]
|
11
|
+
config/database.yml FLX_DB_NAME PROJECT_NAME
|
12
|
+
config/database.yml FLX_DB_HOST DB_HOST
|
13
|
+
config/database.yml FLX_DB_USER DB_USER
|
14
|
+
config/database.yml FLX_DB_PASS DB_PASSWORD
|
15
|
+
public/dispatch.fcgi USER_NAME PROJECT_NAME
|
16
|
+
|
17
|
+
[setup]
|
18
|
+
bash fluxflex_setup.sh
|
19
|
+
bash fluxflex_rake.sh
|
20
|
+
|
21
|
+
[deploy]
|
22
|
+
bash fluxflex_deploy.sh
|
@@ -0,0 +1,9 @@
|
|
1
|
+
export GEM_HOME=$HOME/.gem/ruby/1.9.1/
|
2
|
+
export GEM_PATH=$GEM_HOME
|
3
|
+
export PATH=$PATH:/usr/local/rvm/rubies/ruby-1.9.2-p180/bin:$HOME/.gem/ruby/1.9.1/bin
|
4
|
+
|
5
|
+
gem install rails --no-ri --no-rdoc
|
6
|
+
gem install mysql --no-ri --no-rdoc
|
7
|
+
gem install bundler --no-ri --no-rdoc
|
8
|
+
|
9
|
+
bundle install --without development
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env /usr/local/rvm/rubies/ruby-1.9.2-p180/bin/ruby
|
2
|
+
|
3
|
+
# for ruby 1.9.2-p180
|
4
|
+
__user_home = "/home/USER_NAME"
|
5
|
+
__rails_root = ""
|
6
|
+
|
7
|
+
__rails_root = __user_home + __rails_root
|
8
|
+
|
9
|
+
ENV['GEM_HOME'] = __user_home + "/.gem/ruby/1.9.1/"
|
10
|
+
ENV['GEM_PATH'] = ENV['GEM_HOME']
|
11
|
+
ENV['RAILS_ENV'] ||= 'production'
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'rack'
|
15
|
+
require 'fcgi'
|
16
|
+
include Rack
|
17
|
+
|
18
|
+
require_relative "../config/environment"
|
19
|
+
|
20
|
+
class Rack::PathInfoRewriter
|
21
|
+
|
22
|
+
def initialize(app)
|
23
|
+
@app = app
|
24
|
+
end
|
25
|
+
|
26
|
+
def call(env)
|
27
|
+
env.delete('SCRIPT_NAME')
|
28
|
+
parts = env['REQUEST_URI'].split('?')
|
29
|
+
env['PATH_INFO'] = parts[0]
|
30
|
+
env['QUERY_STRING'] = parts[1].to_s
|
31
|
+
@app.call(env)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
Handler::FastCGI.run Rack::PathInfoRewriter.new(FluxflexSample::Application)
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rspec'
|
4
|
+
require 'flx-tools'
|
5
|
+
|
6
|
+
# Requires supporting files with custom matchers and macros, etc,
|
7
|
+
# in ./support/ and its subdirectories.
|
8
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,153 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: flx-tools
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.1.0
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- masarakki
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-07-17 00:00:00 +09:00
|
14
|
+
default_executable:
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: rake
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - "="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.8.7
|
24
|
+
type: :runtime
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: *id001
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rails
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: "0"
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: *id002
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: rspec
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 2.3.0
|
46
|
+
type: :development
|
47
|
+
prerelease: false
|
48
|
+
version_requirements: *id003
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: bundler
|
51
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ~>
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 1.0.0
|
57
|
+
type: :development
|
58
|
+
prerelease: false
|
59
|
+
version_requirements: *id004
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: jeweler
|
62
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ~>
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: 1.6.4
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: *id005
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: rcov
|
73
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: "0"
|
79
|
+
type: :development
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: *id006
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: rspec-rails
|
84
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: "0"
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: *id007
|
93
|
+
description: Install files to deploy on fluxflex.com
|
94
|
+
email: masaki@hisme.net
|
95
|
+
executables: []
|
96
|
+
|
97
|
+
extensions: []
|
98
|
+
|
99
|
+
extra_rdoc_files:
|
100
|
+
- LICENSE.txt
|
101
|
+
- README.rdoc
|
102
|
+
files:
|
103
|
+
- .document
|
104
|
+
- .rspec
|
105
|
+
- Gemfile
|
106
|
+
- Gemfile.lock
|
107
|
+
- LICENSE.txt
|
108
|
+
- README.rdoc
|
109
|
+
- Rakefile
|
110
|
+
- VERSION
|
111
|
+
- lib/flx-tools.rb
|
112
|
+
- lib/generators/flux_flex/install_generator.rb
|
113
|
+
- lib/generators/flux_flex/templates/.flx
|
114
|
+
- lib/generators/flux_flex/templates/.htaccess
|
115
|
+
- lib/generators/flux_flex/templates/fluxflex_deploy.sh
|
116
|
+
- lib/generators/flux_flex/templates/fluxflex_rake.sh
|
117
|
+
- lib/generators/flux_flex/templates/fluxflex_setup.sh
|
118
|
+
- lib/generators/flux_flex/templates/flx_dispatch.fcgi
|
119
|
+
- spec/flx-tools_spec.rb
|
120
|
+
- spec/spec_helper.rb
|
121
|
+
has_rdoc: true
|
122
|
+
homepage: http://github.com/masarakki/flx-tools
|
123
|
+
licenses:
|
124
|
+
- MIT
|
125
|
+
post_install_message:
|
126
|
+
rdoc_options: []
|
127
|
+
|
128
|
+
require_paths:
|
129
|
+
- lib
|
130
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
131
|
+
none: false
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
hash: -979754221
|
136
|
+
segments:
|
137
|
+
- 0
|
138
|
+
version: "0"
|
139
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
|
+
none: false
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: "0"
|
145
|
+
requirements: []
|
146
|
+
|
147
|
+
rubyforge_project:
|
148
|
+
rubygems_version: 1.6.2
|
149
|
+
signing_key:
|
150
|
+
specification_version: 3
|
151
|
+
summary: Install files to deploy on fluxflex.com
|
152
|
+
test_files: []
|
153
|
+
|