lucie-bin 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8fa8fd40d1dbfe9a06e7725f28e9a4b008c91b5e
4
+ data.tar.gz: b8c5f23b8332860a9d5e05ed2e04d9fe31d02e6a
5
+ SHA512:
6
+ metadata.gz: 7d055fb143ad06ffff34561dab1df78180fd41935f622fd4e2a15a575bf10cd9adff623b2485d3bf3acc0b5c76f988b749ef7d2c07c548a728c334f425072fe2
7
+ data.tar.gz: c6a48d8b2220be77cb9bc59b872c4624ec7965ec2c33c53e9b23a1fd6614cfc083c1cd0ae50da58720ee8fd0aae69765bcb863bd6f4150f8fb5c698c3bc14620
data/Gemfile CHANGED
@@ -2,4 +2,4 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem "lucie"
5
+ gem "lucie-lib"
data/Rakefile CHANGED
@@ -2,10 +2,20 @@ require "bundler/gem_tasks"
2
2
  require 'rake/testtask'
3
3
 
4
4
  Rake::TestTask.new do |t|
5
- t.libs << 'lib/lucie'
6
- t.libs << 'test'
7
- t.test_files = FileList['test/*/*_test.rb']
5
+ t.libs << 'app'
6
+ t.libs << 'app/controllers'
7
+ t.libs << 'spec'
8
+ t.test_files = FileList['spec/*/*_spec.rb']
8
9
  t.verbose = false
9
- t.warning = true
10
+ t.warning = true if ENV["TRAVIS"]
11
+ end
12
+ task :default => :test
13
+
14
+ if !ENV["TRAVIS"]
15
+ require 'rdoc/task'
16
+ RDoc::Task.new :doc do |rdoc|
17
+ rdoc.rdoc_dir = '../doc'
18
+ rdoc.options << '-f' << 'sdoc'
19
+ rdoc.rdoc_files.include("lib/*.rb")
20
+ end
10
21
  end
11
- task :default => :test
@@ -0,0 +1,19 @@
1
+ class NewController < Controller::Base
2
+
3
+ include Snippets::Template
4
+
5
+ def index
6
+ @project_name = params.shift
7
+ @lucie_version = File.read(File.join([app.root, "../version"])).strip
8
+
9
+ template("new/bin/bin.tt", "#{@project_name}/bin/#{@project_name}")
10
+ template("new/app/application_controller.rb.tt", "#{@project_name}/app/controllers/application_controller.rb")
11
+ template("new/Gemfile.tt", "#{@project_name}/Gemfile")
12
+
13
+ File.chmod(0755, "#{app.pwd}/#{@project_name}/bin/#{@project_name}")
14
+ end
15
+
16
+ def no_method
17
+ index
18
+ end
19
+ end
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "lucie-lib", "~><%= @lucie_version %>"
@@ -0,0 +1,9 @@
1
+ class ApplicationController < Controller::Base
2
+ # include Snippets::Template
3
+
4
+ def help
5
+ puts "HELP <%= @project_name %>"
6
+ puts ""
7
+ puts "<%= @project_name %> [help]"
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ Signal.trap("INT") { exit 1 }
4
+
5
+ # Should not buffer stdout and strerr
6
+ $stdout.sync = true
7
+ $stderr.sync = true
8
+
9
+ require "rubygems"
10
+ require "bundler"
11
+ Bundler.require(:default)
12
+
13
+ App.run()
data/lucie-bin.gemspec CHANGED
@@ -1,21 +1,24 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  version = File.read(File.expand_path('../../version', __FILE__)).strip
3
- #lib = File.expand_path('../lib', __FILE__)
4
- #$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
3
 
6
- Gem::Specification.new do |gem|
7
- gem.name = "lucie-bin"
8
- gem.version = version
9
- gem.authors = ["Nucc"]
10
- gem.email = ["nucc@bteam.hu"]
11
- gem.description = %q{Command line utility framework}
12
- gem.summary = %q{}
13
- gem.homepage = ""
4
+ Gem::Specification.new do |s|
5
+ s.name = "lucie-bin"
6
+ s.version = version
7
+ s.authors = ["Nucc"]
8
+ s.email = ["nucc@bteam.hu"]
9
+ s.description = %q{Command line utility framework}
10
+ s.summary = %q{}
11
+ s.homepage = ""
14
12
 
15
- gem.files = `git ls-files`.split($/)
16
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13
+ s.bindir = 'bin'
14
+ s.executables = ["lucie"]
18
15
 
19
- gem.add_dependency "lucie-lib", version
16
+ s.files = `git ls-files`.split($/)
17
+ s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
20
19
 
20
+ s.add_dependency "lucie-lib", version
21
+ s.add_development_dependency "rake", "10.0.3"
22
+ s.add_development_dependency "sdoc"
23
+ s.add_development_dependency "minitest", "4.6"
21
24
  end
@@ -0,0 +1 @@
1
+ #!/bin/bash
@@ -0,0 +1,65 @@
1
+ require 'spec_helper'
2
+ require 'new_controller'
3
+ require 'shellwords'
4
+
5
+ describe NewController do
6
+
7
+ describe :index do
8
+ @before_all ||= begin
9
+ @tmp = File.expand_path("../../../tmp", __FILE__)
10
+ @bin = File.expand_path("../../../bin/lucie", __FILE__)
11
+ system "cd #{Shellwords.escape(@tmp)} && #{Shellwords.escape(@bin)} new app_new"
12
+ end
13
+
14
+ it "should create a new project" do
15
+ assert File.directory?(app_dir)
16
+ end
17
+
18
+ it "should generate runnable file" do
19
+ assert File.executable?(File.join(app_dir, "bin/app_new"))
20
+ end
21
+
22
+ it "should generate application controller file" do
23
+ exists?("app/controllers/application_controller.rb")
24
+ end
25
+
26
+ it "should generate a Gemfile" do
27
+ exists?("Gemfile")
28
+ end
29
+
30
+ it "should include the lucie-lib in the Gemfile" do
31
+ found = false
32
+ File.open(app_path("Gemfile")) do |f|
33
+ f.each_line do |line|
34
+ found ||= (line =~ /lucie-lib/)
35
+ end
36
+ end
37
+ assert found
38
+ end
39
+
40
+ after_all do
41
+ @tmp = File.expand_path("../../../tmp", __FILE__)
42
+ system "cd #{Shellwords.escape(@tmp)} && rm -rf app_new"
43
+ end
44
+
45
+ end
46
+
47
+ private
48
+
49
+ def exists?(relative_path)
50
+ File.exists?(app_path(relative_path))
51
+ end
52
+
53
+ def app_path(relative_path)
54
+ File.join(app_dir, relative_path)
55
+ end
56
+
57
+ def tmp_dir
58
+ File.expand_path("../../../tmp", __FILE__)
59
+ end
60
+
61
+ def app_dir
62
+ File.join(tmp_dir, "app_new")
63
+ end
64
+
65
+ end
@@ -0,0 +1,23 @@
1
+ require_relative "../../lucie-lib/lib/lucie"
2
+ require 'minitest/autorun'
3
+ require 'minitest/spec'
4
+
5
+ class Minitest::Spec
6
+ def setup
7
+ App.init
8
+ end
9
+ end
10
+
11
+ module Kernel
12
+
13
+ def after_all &block
14
+ MiniTest::Unit.after_tests do
15
+ yield block
16
+ end
17
+ end
18
+
19
+ def var sym
20
+ self.class.instance_variable_get :"@#{sym}"
21
+ end
22
+
23
+ end
data/tmp/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ # Ignore everything in this directory
2
+ *
3
+ # Except this file
4
+ !.gitignore
metadata CHANGED
@@ -1,32 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lucie-bin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.0.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - Nucc
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-04-01 00:00:00.000000000 Z
11
+ date: 2013-09-15 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: lucie-lib
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - '='
20
18
  - !ruby/object:Gem::Version
21
- version: 0.0.2
19
+ version: 0.0.4
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - '='
28
25
  - !ruby/object:Gem::Version
29
- version: 0.0.2
26
+ version: 0.0.4
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 10.0.3
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 10.0.3
41
+ - !ruby/object:Gem::Dependency
42
+ name: sdoc
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: '4.6'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: '4.6'
30
69
  description: Command line utility framework
31
70
  email:
32
71
  - nucc@bteam.hu
@@ -37,30 +76,39 @@ extra_rdoc_files: []
37
76
  files:
38
77
  - Gemfile
39
78
  - Rakefile
79
+ - app/controllers/new_controller.rb
80
+ - app/templates/new/Gemfile.tt
81
+ - app/templates/new/app/application_controller.rb.tt
82
+ - app/templates/new/bin/bin.tt
40
83
  - bin/lucie
41
84
  - lucie-bin.gemspec
85
+ - project/bin/project
86
+ - spec/functionals/new_spec.rb
87
+ - spec/spec_helper.rb
88
+ - tmp/.gitignore
42
89
  homepage: ''
43
90
  licenses: []
91
+ metadata: {}
44
92
  post_install_message:
45
93
  rdoc_options: []
46
94
  require_paths:
47
95
  - lib
48
96
  required_ruby_version: !ruby/object:Gem::Requirement
49
- none: false
50
97
  requirements:
51
- - - ! '>='
98
+ - - '>='
52
99
  - !ruby/object:Gem::Version
53
100
  version: '0'
54
101
  required_rubygems_version: !ruby/object:Gem::Requirement
55
- none: false
56
102
  requirements:
57
- - - ! '>='
103
+ - - '>='
58
104
  - !ruby/object:Gem::Version
59
105
  version: '0'
60
106
  requirements: []
61
107
  rubyforge_project:
62
- rubygems_version: 1.8.25
108
+ rubygems_version: 2.0.3
63
109
  signing_key:
64
- specification_version: 3
110
+ specification_version: 4
65
111
  summary: ''
66
- test_files: []
112
+ test_files:
113
+ - spec/functionals/new_spec.rb
114
+ - spec/spec_helper.rb