comma_separated_storage 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -47,3 +47,7 @@ Or install it yourself as:
47
47
  3. Commit your changes (`git commit -am 'Add some feature'`)
48
48
  4. Push to the branch (`git push origin my-new-feature`)
49
49
  5. Create new Pull Request
50
+
51
+ ## Authors
52
+
53
+ [Conan Dalton](http://www.conandalton.net)
@@ -7,7 +7,7 @@ require 'comma_separated_storage/version'
7
7
  Gem::Specification.new do |gem|
8
8
  gem.name = "comma_separated_storage"
9
9
  gem.version = CommaSeparatedStorage::VERSION
10
- gem.authors = ["conanite"]
10
+ gem.authors = ["Conan Dalton"]
11
11
  gem.email = ["conan@conandalton.net"]
12
12
  gem.description = %q{Create utility methods to access an attribute as a list but store it as a comma-separated string}
13
13
  gem.summary = %q{Given an object with a string attribute containing a comma-separated list of items,
@@ -9,6 +9,7 @@ module CommaSeparatedStorage
9
9
  line = __LINE__ + 1
10
10
  code = %{
11
11
  def #{singular}_list= array
12
+ array = [array] unless array.is_a?(Array)
12
13
  self.#{attribute}= array.join(',')
13
14
  end
14
15
 
@@ -1,3 +1,3 @@
1
1
  module CommaSeparatedStorage
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -68,6 +68,12 @@ describe CommaSeparatedStorage do
68
68
  widget.languages = ""
69
69
  widget.language_list.should == []
70
70
  end
71
+
72
+ it "should convert a non-array argument to an array of length 1" do
73
+ widget.language_list = "ru"
74
+ widget.languages.should == "ru"
75
+ widget.language_list.should == ["ru"]
76
+ end
71
77
  end
72
78
 
73
79
  describe "each_lang" do
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comma_separated_storage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
- - conanite
8
+ - Conan Dalton
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-12 00:00:00.000000000 Z
12
+ date: 2013-04-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec