rsm 0.1.alpha2 → 0.1.beta1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1 +1,4 @@
1
1
  *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/CHANGES.md CHANGED
@@ -1,15 +1,21 @@
1
- 0.1.alpha2 (2011-08-28)
2
- =======================
1
+ # 0.1.beta1 / August 30, 2011
2
+
3
+ * Methods in `Rsm::Actions` use `name` attribute
4
+ * Using autload instead of require
5
+ * Updated gemsepc. Added Gemfile, Rakefile
6
+
7
+ # 0.1.alpha2 / August 29, 2011
8
+
3
9
  * Splitted Nginx and Rails application tasks
4
10
  * Using relative paths
5
11
  * Fixed application root in unicorn template
6
12
 
7
- 0.1.alpha1 (2011-08-28)
8
- =======================
13
+ # 0.1.alpha1 / August 28, 2011
14
+
9
15
  * Created tasks:
10
- - create Nginx virtual server config from template
11
- - enable Nginx virtual server config
12
- - clone or download and unpack Rails application from TGZ or TBZ2 archive
13
- - set permission for Rails application
14
- - create Unicorn config from template
15
- - run unicorn server
16
+ - create Nginx virtual server config from template
17
+ - enable Nginx virtual server config
18
+ - clone or download and unpack Rails application from TGZ or TBZ2 archive
19
+ - set permission for Rails application
20
+ - create Unicorn config from template
21
+ - run unicorn server
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in rsm.gemspec
4
+ gemspec
data/README.md CHANGED
@@ -33,8 +33,14 @@ Source code has MIT license
33
33
  Installation
34
34
  ------------
35
35
 
36
- Install from RubyGems
37
- # gem install rsm --pre # usually most operations requires super-user access
36
+ Install from RubyGems:
37
+
38
+ # gem install rsm --pre # usually most operations requires super-user access
39
+
40
+ Ussage
41
+ -----
42
+
43
+ Run `rsm -T` for details
38
44
 
39
45
  Documentation
40
46
  -------------
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.alpha2
1
+ 0.1.beta1
data/lib/rsm/actions.rb CHANGED
@@ -1,25 +1,28 @@
1
1
  module Rsm
2
2
  module Actions
3
+ TAR_OPTS = {:gz => '-z', :bz2 => '-j'}.freeze
4
+
3
5
  # relative downloaded filename
4
- def downloaded_file(compressor)
6
+ # *name*:: application name
7
+ # *compressor*:: +:gz+ or +:bz2+
8
+ def downloaded_file(name, compressor)
5
9
  "#{name}.tar.#{compressor}"
6
10
  end
7
11
 
8
12
  # download archive form +uri+ and temporary save it
13
+ # *name*:: application name
14
+ # *uri*:: source URI - supported by +open-uri+.
9
15
  # *compressor*:: +:gz+ or +:bz2+
10
- def fetch_temporary_archive(uri, compressor)
11
- get uri, downloaded_file(compressor)
16
+ def fetch_temporary_archive(name, uri, compressor)
17
+ get uri, downloaded_file(name, compressor)
12
18
  end
13
19
 
14
20
  # unpack temporary archive file
21
+ # *name*:: application name
15
22
  # *compressor*:: +:gz+ or +:bz2+
16
- def unpack_compressed_archive(compressor)
17
- tar_opts = {:gz => '-z', :bz2 => '-j'}
18
- opt = tar_opts[compressor]
19
- inside destination_root do
20
- run "tar #{opt} -xf #{downloaded_file(compressor)}"
21
- remove_file downloaded_file(compressor)
22
- end
23
+ def unpack_compressed_archive(name, compressor)
24
+ opt = TAR_OPTS[compressor]
25
+ run "tar --remove-files #{opt} -xf #{downloaded_file(name, compressor)}"
23
26
  end
24
27
  end
25
- end
28
+ end
@@ -29,23 +29,25 @@ module Rsm
29
29
  end
30
30
 
31
31
  def download
32
- empty_directory "."
33
- if options[:git]
34
- run "git clone #{options[:git]} #{application_root}"
35
- elsif options[:tgz]
36
- fetch_temporary_archive(options[:tgz], :gz)
37
- unpack_compressed_archive(:gz)
38
- elsif options[:tbz2]
39
- fetch_temporary_archive(options[:tbz2], :bz2)
40
- unpack_compessed_archive(:bz2)
41
- else
42
- say "No source URI specified. Use --git, --tgz or --tbz2 option with URI passed"
43
- exit 1
32
+ empty_directory application_root
33
+ inside application_root do
34
+ if options[:git]
35
+ run "git clone #{options[:git]} ."
36
+ elsif options[:tgz]
37
+ fetch_temporary_archive(name, options[:tgz], :gz)
38
+ unpack_compressed_archive(name, :gz)
39
+ elsif options[:tbz2]
40
+ fetch_temporary_archive(name, options[:tbz2], :bz2)
41
+ unpack_compessed_archive(name, :bz2)
42
+ else
43
+ say "No source URI specified. Use --git, --tgz or --tbz2 option with URI passed"
44
+ exit 1
45
+ end
44
46
  end
45
47
  end
46
48
 
47
49
  def permissions
48
- inside destination_root do
50
+ inside application_root do
49
51
  empty_directory "log"
50
52
  empty_directory "tmp"
51
53
  run "chown #{options[:user]}:#{options[:group]} -R ."
@@ -59,4 +61,4 @@ module Rsm
59
61
  end
60
62
  end
61
63
  end
62
- end
64
+ end
data/lib/rsm.rb CHANGED
@@ -2,6 +2,13 @@ require 'pathname'
2
2
  require 'thor'
3
3
  require 'thor/group'
4
4
  require 'thor/util'
5
- require 'rsm/actions'
6
- require 'rsm/install'
7
- require 'rsm/runner'
5
+
6
+ module Rsm
7
+ autoload :Actions, 'rsm/actions'
8
+ autoload :Runner, 'rsm/runner'
9
+
10
+ module Install
11
+ autoload :Nginx, 'rsm/install/nginx'
12
+ autoload :Rails, 'rsm/install/rails'
13
+ end
14
+ end
data/rsm.gemspec CHANGED
@@ -1,4 +1,6 @@
1
- require File.expand_path('lib/rsm/version', File.dirname(__FILE__))
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "rsm/version"
2
4
 
3
5
  Gem::Specification.new do |s|
4
6
  s.name = 'rsm'
@@ -7,17 +9,21 @@ Gem::Specification.new do |s|
7
9
  s.homepage = 'https://github.com/asux/rsm'
8
10
  s.email = 'a.ulyanitsky@gmail.com'
9
11
  s.author = 'Oleksandr Ulianytskyi'
12
+ s.license = 'MIT'
10
13
  s.version = Rsm::VERSION
11
- s.files = `git ls-files`.split("\n")
12
14
  s.date = File.mtime(File.expand_path('VERSION', File.dirname(__FILE__)))
13
- s.executables = Dir['bin/*'].map{|f| File.basename(f)}
14
- s.default_executable = 'rsm'
15
15
  s.extra_rdoc_files = ['README.md', 'CHANGES.md', 'VERSION']
16
- s.license = 'MIT'
17
16
  s.rdoc_options << '--main' << 'README.md' << '--line-numbers'
17
+
18
+ s.files = `git ls-files`.split("\n")
19
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
+
22
+ s.default_executable = 'rsm'
23
+
18
24
  s.requirements << 'A coreutils installed'
19
25
  s.requirements << 'A Git installed'
20
26
  s.requirements << 'A Nginx installed'
21
27
  s.requirements << 'You must have super-user access'
22
- s.add_dependency 'thor'
28
+ s.add_dependency 'thor', '~> 0.14.6'
23
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsm
3
3
  version: !ruby/object:Gem::Version
4
- hash: 592303009
4
+ hash: 62196313
5
5
  prerelease: 4
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - alpha
10
- - 2
11
- version: 0.1.alpha2
9
+ - beta
10
+ - 1
11
+ version: 0.1.beta1
12
12
  platform: ruby
13
13
  authors:
14
14
  - Oleksandr Ulianytskyi
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-08-29 00:00:00 Z
19
+ date: 2011-08-30 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: thor
@@ -24,12 +24,14 @@ dependencies:
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ">="
27
+ - - ~>
28
28
  - !ruby/object:Gem::Version
29
- hash: 3
29
+ hash: 43
30
30
  segments:
31
31
  - 0
32
- version: "0"
32
+ - 14
33
+ - 6
34
+ version: 0.14.6
33
35
  type: :runtime
34
36
  version_requirements: *id001
35
37
  description: Thor tasks for rapid deployment new rails apps on server
@@ -46,12 +48,13 @@ files:
46
48
  - .gitignore
47
49
  - .rvmrc
48
50
  - CHANGES.md
51
+ - Gemfile
49
52
  - README.md
53
+ - Rakefile
50
54
  - VERSION
51
55
  - bin/rsm
52
56
  - lib/rsm.rb
53
57
  - lib/rsm/actions.rb
54
- - lib/rsm/install.rb
55
58
  - lib/rsm/install/nginx.rb
56
59
  - lib/rsm/install/rails.rb
57
60
  - lib/rsm/runner.rb
data/lib/rsm/install.rb DELETED
@@ -1,2 +0,0 @@
1
- require 'rsm/install/nginx'
2
- require 'rsm/install/rails'