casket 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/.gitignore +1 -0
  2. data/README.rdoc +13 -1
  3. data/casket.gemspec +10 -15
  4. data/lib/casket.rb +8 -6
  5. metadata +3 -4
  6. data/bin/casket +0 -40
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  *.swp
2
2
  *~
3
3
  *.casket
4
+ *.gem
data/README.rdoc CHANGED
@@ -21,13 +21,25 @@ Install Cascet from GitHub repository
21
21
 
22
22
  == Getting started
23
23
 
24
+ === Ruby project requirements
25
+
26
+ To make your application self-executive create rake task to initialize application process. The task should be bind to default task. For example:
27
+
28
+ require 'hello_world.rb'
29
+
30
+ task :launch_application do # create task
31
+ HelloWorld.run # initiate application
32
+ end
33
+
34
+ task :default => :launch_application # bind task to default one
35
+
24
36
  === Creating deployment package
25
37
 
26
38
  To create Casket package simply go to your application directory and type:
27
39
 
28
40
  $ casket --build
29
41
 
30
- Then you should get an package with extension *.casket. Your application should have an Rakefile with default task running project.
42
+ Then you should get an package with extension *.casket.
31
43
 
32
44
  === Running Casket projects
33
45
 
data/casket.gemspec CHANGED
@@ -1,17 +1,14 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
- # -*- encoding: utf-8 -*-
1
+ require 'rubygems'
5
2
 
6
- Gem::Specification.new do |s|
7
- s.name = %q{casket}
8
- s.version = "0.1.1"
3
+ CASKET_GEMSPEC = Gem::Specification.new do |s|
4
+ s.name = "casket"
5
+ s.version = "0.1.2"
9
6
 
10
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
8
  s.authors = ["Paweł Placzyński"]
12
- s.date = %q{2010-11-15}
13
- s.description = %q{Packaging system for Ruby similar to JAR in Java.}
14
- s.email = %q{placek@ragnarson.com}
9
+ s.date = "2010-11-15"
10
+ s.description = "Packaging system for Ruby similar to JAR in Java."
11
+ s.email = "placek@ragnarson.com"
15
12
  s.extra_rdoc_files = [
16
13
  "README.rdoc"
17
14
  ]
@@ -19,22 +16,20 @@ Gem::Specification.new do |s|
19
16
  ".gitignore",
20
17
  "README.rdoc",
21
18
  "casket.gemspec",
22
- "bin/casket",
23
19
  "lib/casket.rb",
24
20
  "lib/minitar.rb",
25
21
  "lib/minitar/command.rb",
26
22
  "spec/casket_spec.rb",
27
23
  "spec/spec_helper.rb"
28
24
  ]
29
- s.homepage = %q{http://github.com/placek/casket}
25
+ s.homepage = "http://github.com/placek/casket"
30
26
  s.rdoc_options = ["--charset=UTF-8"]
31
27
  s.require_paths = ["lib"]
32
- s.rubygems_version = %q{1.3.7}
33
- s.summary = %q{Packaging system for Ruby similar to JAR in Java.}
28
+ s.rubygems_version = "1.3.7"
29
+ s.summary = "Packaging system for Ruby similar to JAR in Java."
34
30
  s.test_files = [
35
31
  "spec/spec_helper.rb",
36
32
  "spec/casket_spec.rb"
37
33
  ]
38
34
 
39
35
  end
40
-
data/lib/casket.rb CHANGED
@@ -4,13 +4,14 @@ include Archive::Tar
4
4
 
5
5
  class Casket
6
6
 
7
- # initializes environment variables
7
+ # Initializes enivironment configuration. Constructor of Cascet instance.
8
8
  def initialize
9
9
  @fs = File::SEPARATOR
10
10
  @ext = "casket"
11
11
  end
12
12
 
13
- # simple tar packing
13
+ # Method that checks directory and packs it into a package. It uses tar
14
+ # algorithm. Parameter directory_path points on directory to pack.
14
15
  def pack directory_path
15
16
  Dir.chdir directory_path
16
17
  name = Dir.pwd.split(@fs).last
@@ -20,7 +21,8 @@ class Casket
20
21
  end
21
22
  end
22
23
 
23
- # simple tar unpacking to temporary directory
24
+ # Method that unpacks Casket package to system temporary directory.
25
+ # Parameter file_path points on Casket package.
24
26
  def unpack file_path
25
27
  name = file_path.split(@fs).last
26
28
  Dir.chdir Dir.tmpdir
@@ -30,18 +32,18 @@ class Casket
30
32
  @temp_dir = Dir.pwd
31
33
  end
32
34
 
33
- # deleting temporary files
35
+ # Method that removes temporary files from system temp.
34
36
  def close
35
37
  FileUtils.rm_rf @temp_dir
36
38
  end
37
39
 
38
- # running "bundle instal" on app
40
+ # Method running "bundle instal" on application.
39
41
  def bundle
40
42
  Dir.chdir @temp_dir
41
43
  system("bundle install")
42
44
  end
43
45
 
44
- # running "rake" on app
46
+ # Method running "rake" on application.
45
47
  def rake
46
48
  Dir.chdir @temp_dir
47
49
  system("rake")
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: casket
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Pawe\xC5\x82 Placzy\xC5\x84ski"
@@ -31,7 +31,6 @@ files:
31
31
  - .gitignore
32
32
  - README.rdoc
33
33
  - casket.gemspec
34
- - bin/casket
35
34
  - lib/casket.rb
36
35
  - lib/minitar.rb
37
36
  - lib/minitar/command.rb
data/bin/casket DELETED
@@ -1,40 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'casket'
4
-
5
- def parse_options args
6
- options = Hash.new
7
- if args.include? "--build"
8
- options[:build] = true
9
- else
10
-
11
- if args.first == "--no-bundle"
12
- options[:no_bundle] = true
13
- args.shift
14
- end
15
- options[:path] = args.first
16
- end
17
- options
18
- end
19
-
20
- options = parse_options(ARGV)
21
- casket = Casket.new
22
-
23
- if options[:build]
24
- casket.pack Dir.pwd
25
- else
26
- if options[:path].nil?
27
- puts "Usage: bla bla"
28
- else
29
- unless options[:no_bundle]
30
- casket.unpack options[:path]
31
- casket.bundle
32
- casket.rake
33
- casket.close
34
- else
35
- casket.unpack options[:path]
36
- casket.rake
37
- casket.close
38
- end
39
- end
40
- end