ricque 0.1.2 → 0.1.3

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.
@@ -43,14 +43,19 @@ module Ricque
43
43
  Dir.chdir(app_path) do
44
44
  puts "Copying files"
45
45
  FileUtils.cp_r template_path, ".", :preserve => true
46
+
46
47
  puts "Renaming file content"
47
- `grep -Irl "Ricque" . | xargs sed -i '' 's/Ricque/#{camelized_app_name}/g'`
48
- `grep -Irl "ricque" . | xargs sed -i '' 's/ricque/#{dashesized_app_name}/g'`
49
- `grep -Irl "{RICQUE_VERSION}" . | xargs sed -i '' 's/{RICQUE_VERSION}/#{Ricque::VERSION}/g'`
48
+ if RUBY_PLATFORM.downcase.include?("darwin")
49
+ sed_args_platform_specific = "''"
50
+ else
51
+ sed_args_platform_specific = "-e"
52
+ end
53
+ `grep -Irl "Ricque" . | xargs sed -i #{sed_args_platform_specific} 's/Ricque/#{camelized_app_name}/g'`
54
+ `grep -Irl "ricque" . | xargs sed -i #{sed_args_platform_specific} 's/ricque/#{dashesized_app_name}/g'`
55
+ `grep -Irl "{RICQUE_VERSION}" . | xargs sed -i #{sed_args_platform_specific}'s/{RICQUE_VERSION}/#{Ricque::VERSION}/g'`
56
+
50
57
  puts "Renaming files"
51
- FileUtils.mv 'lib/ricque', "lib/#{dashesized_app_name}"
52
- FileUtils.mv "lib/ricque.rb", "lib/#{dashesized_app_name}.rb"
53
- FileUtils.mv "lib/tasks/ricque.rake", "lib/tasks/#{dashesized_app_name}.rake"
58
+ `find . -name '*ricque*' | sed -e "p;s/ricque/#{dashesized_app_name}/" | xargs -n2 mv`
54
59
  end
55
60
  end
56
61
  end
@@ -1,3 +1,3 @@
1
1
  module Ricque
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
data/lib/template/Gemfile CHANGED
@@ -1,12 +1,10 @@
1
- source :rubygems
1
+ source "https://rubygems.org"
2
2
 
3
3
  if RUBY_VERSION =~ /1.9/
4
4
  Encoding.default_external = Encoding::UTF_8
5
5
  Encoding.default_internal = Encoding::UTF_8
6
6
  end
7
7
 
8
- gem 'slogger'
9
-
10
8
  group :test do
11
9
  gem 'rspec'
12
10
  gem "simplecov"
@@ -14,5 +12,5 @@ group :test do
14
12
  end
15
13
 
16
14
  group :development, :debug do
17
- gem 'ruby-debug19', :require => 'ruby-debug'
15
+ gem 'debugger', :require => 'debugger'
18
16
  end
@@ -1,11 +1,14 @@
1
1
  GEM
2
- remote: http://rubygems.org/
2
+ remote: https://rubygems.org/
3
3
  specs:
4
- archive-tar-minitar (0.5.2)
5
4
  columnize (0.3.6)
5
+ debugger (1.6.1)
6
+ columnize (>= 0.3.1)
7
+ debugger-linecache (~> 1.2.0)
8
+ debugger-ruby_core_source (~> 1.2.3)
9
+ debugger-linecache (1.2.0)
10
+ debugger-ruby_core_source (1.2.3)
6
11
  diff-lcs (1.1.3)
7
- linecache19 (0.5.12)
8
- ruby_core_source (>= 0.1.4)
9
12
  multi_json (1.5.0)
10
13
  rspec (2.12.0)
11
14
  rspec-core (~> 2.12.0)
@@ -15,30 +18,18 @@ GEM
15
18
  rspec-expectations (2.12.1)
16
19
  diff-lcs (~> 1.1.3)
17
20
  rspec-mocks (2.12.1)
18
- ruby-debug-base19 (0.11.25)
19
- columnize (>= 0.3.1)
20
- linecache19 (>= 0.5.11)
21
- ruby_core_source (>= 0.1.4)
22
- ruby-debug19 (0.11.6)
23
- columnize (>= 0.3.1)
24
- linecache19 (>= 0.5.11)
25
- ruby-debug-base19 (>= 0.11.19)
26
- ruby_core_source (0.1.5)
27
- archive-tar-minitar (>= 0.5.2)
28
21
  simplecov (0.7.1)
29
22
  multi_json (~> 1.0)
30
23
  simplecov-html (~> 0.7.1)
31
24
  simplecov-html (0.7.1)
32
25
  simplecov-rcov (0.2.3)
33
26
  simplecov (>= 0.4.1)
34
- slogger (0.0.9)
35
27
 
36
28
  PLATFORMS
37
29
  ruby
38
30
 
39
31
  DEPENDENCIES
32
+ debugger
40
33
  rspec
41
- ruby-debug19
42
34
  simplecov
43
35
  simplecov-rcov
44
- slogger
@@ -1,15 +1,13 @@
1
1
  require File.expand_path('../boot', __FILE__)
2
2
 
3
3
  module Ricque
4
-
5
- RICQUE_VERSION = '{RICQUE_VERSION}'
6
4
 
7
5
  @@initialized = false
8
6
 
9
7
  def self.initialize!
10
8
  return if @@initialized
11
9
 
12
- puts "#{"="*5} Loading Ricque #{"="*40}"
10
+ puts "#{"="*5} Loading application Ricque #{"="*40}"
13
11
  started_at = Time.now
14
12
 
15
13
  initializer_files_path = ::File.join(::File.expand_path('initializers', self.config_dir), '**', '*.rb')
@@ -18,25 +16,25 @@ module Ricque
18
16
  environment = self.env
19
17
 
20
18
  if !File.exists?(environment_file_path)
21
- puts "\tEnvironment file was not found for [#{self.env}]"
19
+ puts "\t* Environment file was not found for [#{self.env}]"
22
20
  environment = Ricque::DEFAULT_ENVIRONMENT
23
21
  environment_file_path = ::File.join(::File.expand_path('environments', self.config_dir), "#{Ricque::DEFAULT_ENVIRONMENT}.rb")
24
22
  end
25
23
 
26
- puts "\tExecuting before_initialize_blocks (#{before_initialize_blocks.count})"
27
- execute_before_initialize!
24
+ load_path environment_file_path, "\t* Loading environment file for [#{environment}]"
28
25
 
29
- load_path environment_file_path, "\tLoading environment file for [#{environment}]"
26
+ puts "\t* Executing before_initialize_blocks (#{before_initialize_blocks.count})"
27
+ execute_before_initialize!
30
28
 
31
- load_path initializer_files_path, "\tLoading initializers"
29
+ load_path initializer_files_path, "\t* Loading initializers"
32
30
 
33
- load_path lib_files_path, "\tLoading application files"
31
+ load_path lib_files_path, "\t* Loading application files"
34
32
 
35
- puts "\tExecuting after_initialize_blocks (#{after_initialize_blocks.count})"
33
+ puts "\t* Executing after_initialize_blocks (#{after_initialize_blocks.count})"
36
34
  execute_after_initialize!
37
35
 
38
- puts "\tRicque loaded on environment \"#{ENV["RUBY_ENV"]}\" in #{Time.now - started_at} seconds"
39
- puts "#{"="*5} Ricque loaded #{"="*40}"
36
+ puts "\t* Ricque loaded on environment \"#{ENV["RUBY_ENV"]}\" in #{Time.now - started_at} seconds"
37
+ puts "#{"="*5} Application Ricque loaded #{"="*40}"
40
38
 
41
39
  @@initialized = true
42
40
 
@@ -67,27 +65,6 @@ module Ricque
67
65
  block.call configuration
68
66
  end
69
67
 
70
- def self.configuration
71
- @@config ||= {}
72
- @@config
73
- end
74
-
75
- def self.logger= logger
76
- configuration[:logger] = logger
77
- end
78
-
79
- def self.logger
80
- configuration[:logger]
81
- end
82
-
83
- def self.logger?
84
- !configuration[:logger].nil?
85
- end
86
-
87
- def self.development?
88
- ENV["RUBY_ENV"] == "development"
89
- end
90
-
91
68
  def self.load_tasks
92
69
  tasks_files = ::File.join(::File.expand_path('lib/tasks', self.root), '**', '*.rake')
93
70
 
@@ -109,6 +86,6 @@ module Ricque
109
86
  def self.load_path path, message
110
87
  files = ::Dir[path]
111
88
  puts "#{message} (#{files.size})"
112
- files.each { |file| load file }
89
+ files.sort.each { |file| require file }
113
90
  end
114
91
  end
@@ -1,25 +1,31 @@
1
+ require 'logger'
2
+
1
3
  module Ricque
2
- APP_NAME = 'ricque'
4
+ APP_NAME = 'ricque'
3
5
  DEFAULT_ENVIRONMENT = 'development'
6
+ APP_ROOT = ::File.expand_path('../..', __FILE__)
7
+ CONFIG_ROOT = ::File.expand_path('config', APP_ROOT)
8
+ LIB_DIR = ::File.expand_path("lib/#{APP_NAME}", APP_ROOT)
9
+ RICQUE_VERSION = '{RICQUE_VERSION}'
4
10
 
5
11
  def self.app_name
6
12
  APP_NAME
7
13
  end
8
14
 
9
15
  def self.lib_dir
10
- ENV["LIB_DIR_#{app_name}"]
16
+ LIB_DIR
11
17
  end
12
18
 
13
19
  def self.config_dir
14
- ENV["CONFIG_ROOT_#{app_name}"]
20
+ CONFIG_ROOT
15
21
  end
16
22
 
17
23
  def self.config_dir= config_dir
18
- ENV["CONFIG_ROOT_#{app_name}"] = config_dir
24
+ CONFIG_ROOT
19
25
  end
20
26
 
21
27
  def self.root
22
- ENV["APP_ROOT_#{app_name}"]
28
+ APP_ROOT
23
29
  end
24
30
 
25
31
  def self.env
@@ -29,16 +35,31 @@ module Ricque
29
35
  def self.groups
30
36
  ENV["BUNDLER_GROUPS"].split(',')
31
37
  end
32
- end
33
38
 
34
- ENV["APP_ROOT_#{Ricque.app_name}"] = ::File.expand_path('../..', __FILE__)
35
- ENV["CONFIG_ROOT_#{Ricque.app_name}"] = ::File.expand_path('config', ENV["APP_ROOT_#{Ricque.app_name}"])
36
- ENV["LIB_DIR_#{Ricque.app_name}"] = ::File.expand_path("lib/#{Ricque.app_name}", ENV["APP_ROOT_#{Ricque.app_name}"])
39
+ def self.configuration
40
+ @@config ||= {}
41
+ @@config
42
+ end
43
+
44
+ def self.logger= logger
45
+ configuration[:logger] = logger
46
+ end
37
47
 
38
- Ricque::DEFAULT_ENVIRONMENT = "development" unless defined?(Ricque::DEFAULT_ENVIRONMENT)
48
+ def self.logger
49
+ configuration[:logger] ||= Logger.new(STDOUT)
50
+ end
51
+
52
+ def self.logger?
53
+ !configuration[:logger].nil?
54
+ end
55
+
56
+ def self.development?
57
+ ENV["RUBY_ENV"] == "development"
58
+ end
59
+ end
39
60
 
40
- ENV["RUBY_ENV"] = ENV["RUBY_ENV"] || ENV["RACK_ENV"] || Ricque::DEFAULT_ENVIRONMENT
41
- ENV["RACK_ENV"] = ENV["RUBY_ENV"]
61
+ ENV["RUBY_ENV"] = ENV["RUBY_ENV"] || ENV["RACK_ENV"] || Ricque::DEFAULT_ENVIRONMENT
62
+ ENV["RACK_ENV"] = ENV["RUBY_ENV"]
42
63
 
43
64
  ENV["BUNDLER_GROUPS"] = "default,#{ENV["RUBY_ENV"]}"
44
65
 
@@ -0,0 +1 @@
1
+ Ricque.logger = Logger.new(STDOUT) if Ricque.logger.nil?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ricque
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-07 00:00:00.000000000Z
12
+ date: 2013-07-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &70213412739500 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,12 @@ dependencies:
21
21
  version: 3.2.9
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70213412739500
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 3.2.9
25
30
  description: Ricque is a generator of Ruby applications with bootstrap similar to
26
31
  Rails' bootstrap
27
32
  email:
@@ -31,32 +36,29 @@ executables:
31
36
  extensions: []
32
37
  extra_rdoc_files: []
33
38
  files:
34
- - lib/ricque/app_generator.rb
35
- - lib/ricque/version.rb
36
39
  - lib/ricque.rb
40
+ - lib/template/README
37
41
  - lib/template/.gitignore
42
+ - lib/template/script/console
43
+ - lib/template/Gemfile.lock
44
+ - lib/template/doc/README_FOR_APP
45
+ - lib/template/spec/spec_helper.rb
46
+ - lib/template/lib/ricque.rb
47
+ - lib/template/lib/ricque/version.rb
48
+ - lib/template/lib/tasks/ricque.rake
49
+ - lib/template/lib/tasks/rspec.rake
38
50
  - lib/template/.rspec
39
- - lib/template/.rvmrc
40
- - lib/template/config/application.rb
41
51
  - lib/template/config/boot.rb
42
- - lib/template/config/environment.rb
43
52
  - lib/template/config/environments/development.rb
44
53
  - lib/template/config/environments/production.rb
45
54
  - lib/template/config/environments/test.rb
46
- - lib/template/config/initializers/00_slogger.rb
47
- - lib/template/doc/README_FOR_APP
55
+ - lib/template/config/initializers/00_logger.rb
56
+ - lib/template/config/application.rb
57
+ - lib/template/config/environment.rb
48
58
  - lib/template/Gemfile
49
- - lib/template/Gemfile.lock
50
- - lib/template/lib/ricque/version.rb
51
- - lib/template/lib/ricque.rb
52
- - lib/template/lib/tasks/ricque.rake
53
- - lib/template/lib/tasks/rspec.rake
54
- - lib/template/log/.gitkeep
55
59
  - lib/template/Rakefile
56
- - lib/template/README
57
- - lib/template/script/console
58
- - lib/template/spec/spec_helper.rb
59
- - lib/template/tmp/pids/.gitkeep
60
+ - lib/ricque/version.rb
61
+ - lib/ricque/app_generator.rb
60
62
  - bin/ricque
61
63
  homepage:
62
64
  licenses:
@@ -79,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
81
  version: '0'
80
82
  requirements: []
81
83
  rubyforge_project: ricque
82
- rubygems_version: 1.8.11
84
+ rubygems_version: 1.8.25
83
85
  signing_key:
84
86
  specification_version: 3
85
87
  summary: Ricque is a generator of Ruby applications with bootstrap similar to Rails'
data/lib/template/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm --create 1.9.2@ricque
@@ -1,3 +0,0 @@
1
- require 'slogger'
2
-
3
- Ricque.logger = Slogger::CommonLogger.new(Ricque.app_name, Ricque.configuration[:log_level], :local7) if Ricque.logger.nil?
File without changes
File without changes