spicycode-micronaut-rails 0.2.0.0 → 0.2.2

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.
data/Rakefile CHANGED
@@ -1,97 +1,37 @@
1
- require 'rubygems'
2
- require 'rake/gempackagetask'
3
- require 'rubygems/specification'
4
- require File.join(File.dirname(__FILE__), *%w[. lib micronaut rails version])
5
-
6
- GEM = "micronaut-rails"
7
- GEM_VERSION = Micronaut::Rails::Version::STRING
8
- AUTHOR = "Chad Humphries"
9
- EMAIL = "chad@spicycode.com"
10
- HOMEPAGE = "http://github.com/spicycode/micronaut-rails"
11
- SUMMARY = "An excellent replacement for the wheel, Rails edition."
12
-
13
- spec = Gem::Specification.new do |s|
14
- s.name = GEM
15
- s.version = GEM_VERSION
16
- s.platform = Gem::Platform::RUBY
17
- s.has_rdoc = true
18
- s.extra_rdoc_files = ["README", "LICENSE", "RSPEC-LICENSE"]
19
- s.summary = SUMMARY
20
- s.description = s.summary
21
- s.author = AUTHOR
22
- s.email = EMAIL
23
- s.homepage = HOMEPAGE
24
- s.bindir = 'bin'
25
- s.require_path = 'lib'
26
- s.autorequire = GEM
27
- s.add_dependency "actionpack", '>= 2.2.2'
28
- s.add_dependency "spicycode-micronaut", Micronaut::Rails::Version::MICRONAUT_VERSION_STRING
29
- s.files = %w(LICENSE README RSPEC-LICENSE Rakefile) + Dir.glob("{lib,examples}/**/*")
30
- end
31
-
32
- Rake::GemPackageTask.new(spec) do |pkg|
33
- pkg.gem_spec = spec
34
- end
35
-
36
- desc "Install the gem locally"
37
- task :install => [:package] do
38
- sh %{sudo gem install pkg/#{GEM}-#{GEM_VERSION}}
39
- end
40
-
41
- desc "Create a gemspec file"
42
- task :make_gemspec do
43
- File.open("#{GEM}.gemspec", "w") do |file|
44
- file.puts spec.to_ruby
45
- end
1
+ begin
2
+ require 'jeweler'
3
+ Jeweler::Tasks.new do |s|
4
+ s.name = "micronaut-rails"
5
+ s.summary = "An excellent replacement for the wheel on rails..."
6
+ s.email = "chad@spicycode.com"
7
+ s.homepage = "http://github.com/spicycode/micronaut-rails"
8
+ s.description = "An excellent replacement for the wheel on rails..."
9
+ s.authors = ["Chad Humphries"]
10
+ s.files = FileList["[A-Z]*", "{bin,lib,examples}/**/*"]
11
+ s.add_dependency "actionpack", '>= 2.2.2'
12
+ s.add_dependency "spicycode-micronaut", '>= 0.2.2'
13
+ end
14
+ rescue LoadError
15
+ puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
46
16
  end
47
17
 
48
- desc "Print the gemspec to stdout"
49
- task :puts_gemspec do
50
- puts spec.to_ruby
51
- end
18
+ gem 'spicycode-micronaut'
19
+ require 'micronaut/rake_task'
52
20
 
53
- desc 'Run all examples'
54
- task :examples do
55
- examples = Dir["examples/**/*_example.rb"].map { |g| Dir.glob(g) }.flatten
56
- ruby examples.join(" ")
21
+ desc "Run all micronaut examples"
22
+ Micronaut::RakeTask.new :examples do |t|
23
+ t.pattern = "examples/**/*_example.rb"
57
24
  end
58
25
 
59
26
  namespace :examples do
60
27
 
61
- desc "List files that don't have examples"
62
- task :untested do
63
- code = Dir["lib/**/*.rb"].map { |g| Dir.glob(g) }.flatten
64
- examples = Dir["examples/**/*_example.rb"].map { |g| Dir.glob(g) }.flatten
65
- examples.map! { |f| f =~ /examples\/(.*)_example/; "#{$1}.rb" }
66
- missing_examples = (code - examples)
67
- puts
68
- puts "The following files seem to be missing their examples:"
69
- missing_examples.each do |missing|
70
- puts " #{missing}"
71
- end
72
- end
73
-
74
- desc "Run all examples using rcov"
75
- task :coverage do
76
- examples = Dir["examples/**/*_example.rb"].map { |g| Dir.glob(g) }.flatten
77
- result = system "rcov --exclude \"examples/*,gems/*,db/*,/Library/Ruby/*,config/*\" --text-summary --sort coverage --no-validator-links #{examples.join(' ')}"
78
- fail_build unless result
79
- end
80
-
81
- def fail_build
82
- puts
83
- puts "-" * 79
84
- puts "Build Failed"
85
- puts "-" * 79
86
- abort
87
- end
88
-
89
- desc "Delete coverage artifacts"
90
- task :clean_coverage do
91
- rm_rf Dir["coverage/**/*"]
28
+ desc "Run all micronaut examples using rcov"
29
+ Micronaut::RakeTask.new :coverage do |t|
30
+ t.pattern = "examples/**/*_example.rb"
31
+ t.rcov = true
32
+ t.rcov_opts = %[--exclude "examples/*,gems/*,db/*,/Library/Ruby/*,config/*" --text-summary --sort coverage --no-validator-links]
92
33
  end
93
34
 
94
35
  end
95
36
 
96
37
  task :default => 'examples:coverage'
97
- task :clobber_package => 'examples:clean_coverage'
data/VERSION.yml ADDED
@@ -0,0 +1,4 @@
1
+ ---
2
+ :minor: 2
3
+ :patch: 2
4
+ :major: 0
@@ -1,18 +1,19 @@
1
1
  lib_path = File.expand_path(File.dirname(__FILE__) + "/../lib")
2
2
  $LOAD_PATH.unshift lib_path unless $LOAD_PATH.include?(lib_path)
3
3
 
4
- require 'micronaut/rails/version'
4
+ require 'rubygems'
5
+
5
6
  begin
6
- gem "spicycode-micronaut", Micronaut::Rails::Version::MICRONAUT_VERSION_STRING
7
+ gem "spicycode-micronaut", ">= 0.2.2"
7
8
  rescue LoadError => e
8
- puts "\nERROR - This version of micronaut-rails requires micronaut #{Micronaut::Rails::Version::MICRONAUT_VERSION_STRING} - please install with: \n"
9
- puts "gem install spicycode-micronaut --version #{Micronaut::Rails::Version::MICRONAUT_VERSION_STRING}\n"
9
+ puts "\nERROR - This version of micronaut-rails requires micronaut 0.2.2 or higher."
10
+ puts "gem install spicycode-micronaut --version 0.2.2"
10
11
  puts
11
12
  exit(1)
12
13
  end
13
14
  require 'micronaut'
14
15
  require 'micronaut-rails'
15
- require 'rubygems'
16
+
16
17
  gem :mocha
17
18
 
18
19
  module Micronaut
@@ -50,7 +51,5 @@ Micronaut.configure do |config|
50
51
  config.mock_with :mocha
51
52
  config.color_enabled = use_color?
52
53
  config.formatter = :documentation
53
- config.profile_examples = false
54
54
  config.filter_run :focused => true
55
- config.autorun!
56
- end
55
+ end
@@ -5,11 +5,6 @@ module Micronaut
5
5
  module InstanceMethods
6
6
  attr_reader :request, :response, :controller
7
7
 
8
- def assert_routing(path, options, defaults={}, extras={}, message=nil)
9
- method = options[:method] || :get
10
- route_for(params_from(method, path)).should == path
11
- end
12
-
13
8
  def route_for(options)
14
9
  ActionController::Routing::Routes.reload if ActionController::Routing::Routes.empty?
15
10
  ActionController::Routing::Routes.generate(options)
@@ -5,7 +5,7 @@ module Micronaut
5
5
  module ModelStubber
6
6
 
7
7
  def connection
8
- raise MicronautRails::IllegalDataAccessException.new("stubbed/mocked models are not allowed to access the database")
8
+ raise ::Micronaut::Rails::IllegalDataAccessException.new("stubbed/mocked models are not allowed to access the database")
9
9
  end
10
10
 
11
11
  def new_record?
@@ -7,8 +7,8 @@ module Micronaut
7
7
  params = params.dup
8
8
  model = model_class.new
9
9
  model.id = params.delete(:id) || next_id
10
-
11
- model.extend Micronaut::Rails::Mocking::ModelStubber
10
+ model.extend ::Micronaut::Rails::Mocking::ModelStubber
11
+
12
12
  params.keys.each do |prop|
13
13
  model[prop] = params.delete(prop) if model.has_attribute?(prop)
14
14
  end
@@ -8,7 +8,7 @@ module Micronaut
8
8
  # add_stubs) if +stubs+ is passed.
9
9
  def mock_or_stub_model(model_class, mock_or_stub, options = {})
10
10
  model = model_class.new
11
- model.extend Micronaut::Rails::Mocking::ModelStubber
11
+ model.extend ::Micronaut::Rails::Mocking::ModelStubber
12
12
  model_id = next_id
13
13
 
14
14
  stub(errors_stub = Object.new).count.returns(0)
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spicycode-micronaut-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chad Humphries
8
- autorequire: micronaut-rails
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-01-12 00:00:00 -08:00
12
+ date: 2009-02-09 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -26,25 +26,24 @@ dependencies:
26
26
  version_requirement:
27
27
  version_requirements: !ruby/object:Gem::Requirement
28
28
  requirements:
29
- - - ~>
29
+ - - ">="
30
30
  - !ruby/object:Gem::Version
31
- version: 0.2.0
31
+ version: 0.2.2
32
32
  version:
33
- description: An excellent replacement for the wheel, Rails edition.
33
+ description: An excellent replacement for the wheel on rails...
34
34
  email: chad@spicycode.com
35
35
  executables: []
36
36
 
37
37
  extensions: []
38
38
 
39
- extra_rdoc_files:
40
- - README
41
- - LICENSE
42
- - RSPEC-LICENSE
39
+ extra_rdoc_files: []
40
+
43
41
  files:
44
42
  - LICENSE
43
+ - Rakefile
45
44
  - README
46
45
  - RSPEC-LICENSE
47
- - Rakefile
46
+ - VERSION.yml
48
47
  - lib/micronaut
49
48
  - lib/micronaut/rails
50
49
  - lib/micronaut/rails/configuration.rb
@@ -61,7 +60,6 @@ files:
61
60
  - lib/micronaut/rails/mocking/with_mocha.rb
62
61
  - lib/micronaut/rails/mocking/with_rr.rb
63
62
  - lib/micronaut/rails/transactional_database_support.rb
64
- - lib/micronaut/rails/version.rb
65
63
  - lib/micronaut-rails.rb
66
64
  - examples/example_helper.rb
67
65
  - examples/lib
@@ -72,8 +70,9 @@ files:
72
70
  has_rdoc: true
73
71
  homepage: http://github.com/spicycode/micronaut-rails
74
72
  post_install_message:
75
- rdoc_options: []
76
-
73
+ rdoc_options:
74
+ - --inline-source
75
+ - --charset=UTF-8
77
76
  require_paths:
78
77
  - lib
79
78
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -94,6 +93,6 @@ rubyforge_project:
94
93
  rubygems_version: 1.2.0
95
94
  signing_key:
96
95
  specification_version: 2
97
- summary: An excellent replacement for the wheel, Rails edition.
96
+ summary: An excellent replacement for the wheel on rails...
98
97
  test_files: []
99
98
 
@@ -1,15 +0,0 @@
1
- module Micronaut
2
- module Rails
3
- module Version
4
- MAJOR = 0
5
- MINOR = 2
6
- TINY = 0
7
- MINISCULE = 0
8
-
9
- STRING = [MAJOR, MINOR, TINY, MINISCULE].join('.')
10
-
11
- MICRONAUT_VERSION = [MAJOR, MINOR, TINY].join('.')
12
- MICRONAUT_VERSION_STRING = "~> #{MICRONAUT_VERSION}"
13
- end
14
- end
15
- end