snusnu-dm-is-localizable 0.0.7 → 0.0.8
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/CHANGELOG +20 -0
- data/README.textile +10 -2
- data/VERSION +1 -1
- data/dm-is-localizable.gemspec +2 -1
- data/tasks/install.rb +9 -0
- metadata +2 -1
data/CHANGELOG
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
[f33f1e3 | Mon May 18 18:49:28 UTC 2009] snusnu <gamsnjaga@gmail.com>
|
2
|
+
|
3
|
+
* Version bump to 0.0.8
|
4
|
+
|
5
|
+
[5af2511 | Mon May 18 18:09:58 UTC 2009] snusnu <gamsnjaga@gmail.com>
|
6
|
+
|
7
|
+
* updated README to reflect the actual code
|
8
|
+
|
9
|
+
[2543d3c | Mon May 18 18:07:32 UTC 2009] snusnu <gamsnjaga@gmail.com>
|
10
|
+
|
11
|
+
* README cosmetics
|
12
|
+
|
13
|
+
[f222991 | Mon May 18 17:27:34 UTC 2009] snusnu <gamsnjaga@gmail.com>
|
14
|
+
|
15
|
+
* updated README to reflect latest changes to Language
|
16
|
+
|
17
|
+
[4f350db | Mon May 18 17:25:08 UTC 2009] snusnu <gamsnjaga@gmail.com>
|
18
|
+
|
19
|
+
* updated gemspec and CHANGELOG
|
20
|
+
|
1
21
|
[59dd665 | Mon May 18 17:23:50 UTC 2009] snusnu <gamsnjaga@gmail.com>
|
2
22
|
|
3
23
|
* Version bump to 0.0.7
|
data/README.textile
CHANGED
@@ -39,10 +39,16 @@ class Language
|
|
39
39
|
|
40
40
|
property :code, String, :nullable => false, :unique => true, :unique_index => true
|
41
41
|
property :name, String, :nullable => false
|
42
|
-
|
42
|
+
|
43
43
|
# locale string like 'en-US'
|
44
44
|
validates_format :code, :with => /^[a-z]{2}-[A-Z]{2}$/
|
45
45
|
|
46
|
+
|
47
|
+
def self.[](code)
|
48
|
+
return nil if code.nil?
|
49
|
+
first :code => code.to_s.gsub('_', '-')
|
50
|
+
end
|
51
|
+
|
46
52
|
end
|
47
53
|
</code>
|
48
54
|
</pre>
|
@@ -72,7 +78,7 @@ Preliminary support for changing this is available by using the @:class_name@ op
|
|
72
78
|
|
73
79
|
<pre>
|
74
80
|
<code>
|
75
|
-
|
81
|
+
DataMapper::Model.is :localized, :class_name => 'ItemLocalization'
|
76
82
|
</code>
|
77
83
|
</pre>
|
78
84
|
|
@@ -89,6 +95,8 @@ class ItemTranslation
|
|
89
95
|
|
90
96
|
property :name, String
|
91
97
|
property :desc, String
|
98
|
+
|
99
|
+
validates_is_unique :language_id, :scope => :item_id
|
92
100
|
|
93
101
|
belongs_to :item
|
94
102
|
belongs_to :language
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.8
|
data/dm-is-localizable.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{dm-is-localizable}
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.8"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Martin Gamsjaeger (snusnu)"]
|
@@ -41,6 +41,7 @@ Gem::Specification.new do |s|
|
|
41
41
|
"spec/unit/language_spec.rb",
|
42
42
|
"spec/unit/translation_spec.rb",
|
43
43
|
"tasks/changelog.rb",
|
44
|
+
"tasks/install.rb",
|
44
45
|
"tasks/whitespace.rb"
|
45
46
|
]
|
46
47
|
s.homepage = %q{http://github.com/snusnu/dm-is-localizable}
|
data/tasks/install.rb
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
desc "Install gem using sudo"
|
2
|
+
task :install => :build do
|
3
|
+
puts '-' * 65
|
4
|
+
puts ' Put the following model definition in a file called language.rb'
|
5
|
+
puts '-' * 65
|
6
|
+
File.open(ROOT.join('lib/dm-is-localizable/storage/language.rb')).each do |line|
|
7
|
+
puts line
|
8
|
+
end
|
9
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snusnu-dm-is-localizable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Gamsjaeger (snusnu)
|
@@ -80,6 +80,7 @@ files:
|
|
80
80
|
- spec/unit/language_spec.rb
|
81
81
|
- spec/unit/translation_spec.rb
|
82
82
|
- tasks/changelog.rb
|
83
|
+
- tasks/install.rb
|
83
84
|
- tasks/whitespace.rb
|
84
85
|
has_rdoc: false
|
85
86
|
homepage: http://github.com/snusnu/dm-is-localizable
|