forked from spree-contrib/spree_volume_pricing
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Getting the tests running, test_app task is now working
Signed-off-by: Chris Boertien <[email protected]>
- Loading branch information
1 parent
13d164a
commit 9aa0a8f
Showing
9 changed files
with
46 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
*.swp | ||
pkg | ||
Gemfile.lock | ||
spec/dummy | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
before_script: | ||
- "ruby --version" | ||
- "bundle exec rake test_app" | ||
script: "bundle exec rake" | ||
notifications: | ||
irc: "irc.freenode.org#spree" | ||
branches: | ||
only: | ||
- master | ||
rvm: | ||
- 1.8.7 | ||
- 1.9.2 | ||
- 1.9.3 | ||
- ree |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,30 @@ | ||
require "spree_volume_pricing" | ||
|
||
module SpreeVolumePricing | ||
|
||
class Engine < Rails::Engine | ||
|
||
def self.activate | ||
Dir.glob(File.join(File.dirname(__FILE__), "../../app/**/*_decorator*.rb")) do |c| | ||
Rails.configuration.cache_classes ? require(c) : load(c) | ||
end | ||
|
||
String.class_eval do | ||
def to_range | ||
case self.count('.') | ||
when 2 | ||
elements = self.split('..') | ||
return Range.new(elements[0].from(1).to_i, elements[1].to_i) | ||
when 3 | ||
elements = self.split('...') | ||
return Range.new(elements[0].from(1).to_i, elements[1].to_i-1) | ||
else | ||
raise ArgumentError.new("Couldn't convert to Range: #{self}") | ||
end | ||
end | ||
def to_range | ||
case self.count('.') | ||
when 2 | ||
elements = self.split('..') | ||
return Range.new(elements[0].from(1).to_i, elements[1].to_i) | ||
when 3 | ||
elements = self.split('...') | ||
return Range.new(elements[0].from(1).to_i, elements[1].to_i-1) | ||
else | ||
raise ArgumentError.new("Couldn't convert to Range: #{self}") | ||
end | ||
end | ||
end | ||
end | ||
|
||
config.autoload_paths += %W(#{config.root}/lib) | ||
|
||
config.to_prepare &method(:activate).to_proc | ||
|
||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters