scene7-wrapper 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -10,7 +10,7 @@ module Scene7
10
10
  "scl=#{params[:scale_factor]}&crop=#{params[:x].round},#{params[:y].round},#{params[:width].round},#{params[:height].round}&qlt=#{params[:quality] || 95}"
11
11
  end
12
12
 
13
- def self.convert_params_from_scale_first(orig_params)
13
+ def self.convert_params_from_scale_first(orig_params, additional_params = {})
14
14
  {}.tap do |params|
15
15
  scale_factor = orig_params[:scale_factor].to_f
16
16
  params[:scale_factor] = 1.0 / scale_factor
@@ -19,7 +19,7 @@ module Scene7
19
19
  params[:x] = orig_params[:x].to_f / scale_factor
20
20
  params[:y] = orig_params[:y].to_f / scale_factor
21
21
  params[:quality] = orig_params[:quality] if orig_params[:quality]
22
- end
22
+ end.merge!(additional_params)
23
23
  end
24
24
  end
25
25
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{scene7-wrapper}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Brian Rose", "Jim Whiteman"]
12
- s.date = %q{2011-04-11}
12
+ s.date = %q{2011-04-13}
13
13
  s.description = %q{A Scene7 wrapper for Rails 3.x apps.}
14
14
  s.email = %q{brian.rose@factorylabs.com}
15
15
  s.extra_rdoc_files = [
@@ -87,6 +87,11 @@ describe Scene7::Crop do
87
87
  it "converts the top coordinate from the scale-first style" do
88
88
  @result[:y].should == 125
89
89
  end
90
+
91
+ it "accepts additional params" do
92
+ @result = subject.convert_params_from_scale_first(params, {:extra => true})
93
+ @result[:extra].should == true
94
+ end
90
95
  end
91
96
  end
92
97
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scene7-wrapper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 0
10
- version: 0.3.0
9
+ - 1
10
+ version: 0.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brian Rose
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-04-11 00:00:00 -06:00
19
+ date: 2011-04-13 00:00:00 -06:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency