towsta 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,6 +4,7 @@ module Towsta
4
4
  class MoneyKind < MainKind
5
5
 
6
6
  def set content
7
+ content = content.gsub('.','').gsub(',','.') if content.class == String
7
8
  @content = content.to_f
8
9
  end
9
10
 
@@ -1,5 +1,6 @@
1
1
  enable :sessions
2
2
  set :session_secret, ENV['SESSION_KEY']
3
+ set :translations, 'locales'
3
4
 
4
5
  helpers do
5
6
 
@@ -0,0 +1,5 @@
1
+ class String
2
+ def parameterize
3
+ self.gsub(' ', '-').downcase.delete('^a-zA-Z0-9\-')
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Towsta
2
- VERSION = "1.2.4"
2
+ VERSION = "1.2.5"
3
3
  end
@@ -15,6 +15,12 @@ module Towsta
15
15
 
16
16
  attr_accessor :message
17
17
 
18
+ include R18n::Helpers
19
+
20
+ def i18n attr
21
+ self.send eval("t.models.#{self.class.to_s.downcase}.#{attr.to_s}").to_sym
22
+ end
23
+
18
24
  args[:slices].each do |attr, kind|
19
25
  eval "def object_of_#{attr}; @#{attr}; end;"
20
26
  eval "def #{attr}= value; @#{attr} ||= Towsta::Kinds::#{kind[0].upcase + kind[1..-1]}Kind.new; @#{attr}.set value; end;"
data/lib/towsta.rb CHANGED
@@ -11,7 +11,10 @@ require 'bresson'
11
11
  require 'cameraman'
12
12
  require 'sinatra'
13
13
  require 'compass'
14
+ require 'sinatra/content_for'
15
+ require 'sinatra/r18n'
14
16
 
17
+ require File.expand_path('../towsta/string_extension', __FILE__)
15
18
  require File.expand_path('../towsta/kinds/main', __FILE__)
16
19
  require File.expand_path('../towsta/vertical', __FILE__)
17
20
  require File.expand_path('../towsta/synchronizer', __FILE__)
data/towsta.gemspec CHANGED
@@ -22,6 +22,8 @@ Gem::Specification.new do |s|
22
22
  s.add_dependency("sinatra")
23
23
  s.add_dependency("cameraman")
24
24
  s.add_dependency("shotgun")
25
+ s.add_dependency("sinatra-content-for")
26
+ s.add_dependency("sinatra-r18n")
25
27
 
26
28
  s.files = `git ls-files`.split("\n")
27
29
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 2
8
- - 4
9
- version: 1.2.4
8
+ - 5
9
+ version: 1.2.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mortaro
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-11-27 00:00:00 -02:00
17
+ date: 2011-12-08 00:00:00 -02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -121,6 +121,32 @@ dependencies:
121
121
  version: "0"
122
122
  type: :runtime
123
123
  version_requirements: *id008
124
+ - !ruby/object:Gem::Dependency
125
+ name: sinatra-content-for
126
+ prerelease: false
127
+ requirement: &id009 !ruby/object:Gem::Requirement
128
+ none: false
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ segments:
133
+ - 0
134
+ version: "0"
135
+ type: :runtime
136
+ version_requirements: *id009
137
+ - !ruby/object:Gem::Dependency
138
+ name: sinatra-r18n
139
+ prerelease: false
140
+ requirement: &id010 !ruby/object:Gem::Requirement
141
+ none: false
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ segments:
146
+ - 0
147
+ version: "0"
148
+ type: :runtime
149
+ version_requirements: *id010
124
150
  description: Simply integrates the towsta api
125
151
  email:
126
152
  - mortaro@towsta.com
@@ -157,6 +183,7 @@ files:
157
183
  - lib/towsta/login.rb
158
184
  - lib/towsta/memory.rb
159
185
  - lib/towsta/sinatra_extension.rb
186
+ - lib/towsta/string_extension.rb
160
187
  - lib/towsta/synchronizer.rb
161
188
  - lib/towsta/version.rb
162
189
  - lib/towsta/vertical.rb