storage_room 0.1.1 → 0.1.2

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/README.rdoc CHANGED
@@ -12,20 +12,20 @@ To install the library execute:
12
12
 
13
13
  == Basic Usage
14
14
 
15
- This is a walkthrough with all steps you need to setup a devise resource, including model, migration, route files, and optional configuration.
15
+ This is a walkthrough with all steps you need to setup a devise entry, including model, migration, route files, and optional configuration.
16
16
 
17
17
  StorageRoom.authenticate(YOUR_ACCOUNT_ID, YOUR_APPLICATION_API_KEY)
18
18
  collection = StorageRoom::Collection.find('guidebooks')
19
19
 
20
- resources = collection.resources
21
- resource = resources.items.first
20
+ entries = collection.entries
21
+ entry = entries.resources.first
22
22
 
23
- resource[:name] = 'Foobar'
23
+ entry[:name] = 'Foobar'
24
24
 
25
- if resource.save
26
- puts "Resource saved."
25
+ if entry.save
26
+ puts "Entry saved."
27
27
  else
28
- puts "Could not save Resource: #{resource.errors.join(', )}"
28
+ puts "Could not save Entry: #{entry.errors.join(', )}"
29
29
  end
30
30
 
31
31
  You can find the documentation at http://rdoc.info/github/thriventures/storage_room_gem.
data/TODO CHANGED
@@ -1,6 +1,3 @@
1
- - rdoc
2
-
3
-
4
1
  == Version X
5
2
 
6
3
  - have collection fields
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env ruby -rubygems
2
+
3
+ require File.dirname(__FILE__) + '/authentication'
4
+
5
+ # create a entry without fetching the collection
6
+ klass = StorageRoom.class_for_name('Guidebook')
7
+ entry1 = klass.new(:name => 'Foo', :price => 1.23)
8
+
9
+ if entry1.save
10
+ puts "Entry saved"
11
+ else
12
+ puts "Entry could not be saved: #{entry1.errors.join(', ')}"
13
+ end
14
+
15
+ # fetch the collection first
16
+ collection = StorageRoom::Collection.find('guidebooks')
17
+
18
+ entry2 = collection.entry_class.new(:name => 'Bar', :price => 2.23)
19
+
20
+ if entry2.save
21
+ puts "Entry saved"
22
+ else
23
+ puts "Entry could not be saved: #{entry2.errors.join(', ')}"
24
+ end
@@ -4,8 +4,8 @@ require File.dirname(__FILE__) + '/authentication'
4
4
 
5
5
  collection = StorageRoom::Collection.find('guidebooks')
6
6
 
7
- resource = collection.resources.items.first
7
+ entry = collection.entries.resources.first
8
8
 
9
- resource.destroy
9
+ entry.destroy
10
10
 
11
- puts "Destroyed #{resource[:name]}"
11
+ puts "Destroyed #{entry[:name]}"
@@ -6,6 +6,6 @@ collections = StorageRoom::Collection.all
6
6
 
7
7
  puts "Collections:"
8
8
 
9
- collections.items.each do |collection|
9
+ collections.resources.each do |collection|
10
10
  puts "- #{collection[:name]}"
11
11
  end
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby -rubygems
2
+
3
+ require File.dirname(__FILE__) + '/authentication'
4
+
5
+ collection = StorageRoom::Collection.find('guidebooks')
6
+
7
+ entries = collection.entry_class.search(:name => 'Bar')
8
+
9
+ puts "Entries with name 'Bar':"
10
+
11
+ entries.resources.each do |entry|
12
+ puts "- #{entry[:name]}"
13
+ end
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby -rubygems
2
+
3
+ require File.dirname(__FILE__) + '/authentication'
4
+
5
+ collection = StorageRoom::Collection.find('guidebooks')
6
+
7
+ entry = collection.entries.resources.first
8
+
9
+ entry[:name] = 'Foobar'
10
+
11
+ if entry.save
12
+ puts "Entry saved"
13
+ else
14
+ puts "Entry could not be saved: #{entry.errors.join(', ')}"
15
+ end
@@ -1,11 +1,11 @@
1
1
  module StorageRoom
2
- # A container object that contains many models (collections or resources)
2
+ # A container object that contains many models (collections or entries)
3
3
  class Array < Base
4
- attr_accessor :items
4
+ attr_accessor :resources
5
5
 
6
6
 
7
7
  def initialize(attributes = {})
8
- self.items = []
8
+ self.resources = []
9
9
  super
10
10
  end
11
11
 
@@ -13,20 +13,20 @@ module StorageRoom
13
13
  def set_from_api(attributes)
14
14
  super(attributes)
15
15
 
16
- self.items = attributes['items'].map{|item| self.class.create_from_api(item)} # transform hashes to real objects
17
- attributes.delete('items')
16
+ self.resources = attributes['resources'].map{|item| self.class.create_from_api(item)} # transform hashes to real objects
17
+ attributes.delete('resources')
18
18
  end
19
19
 
20
20
  # Reset the Array to its default state with all attributes unset
21
21
  def reset!
22
22
  super
23
- @items = []
23
+ @resources = []
24
24
  end
25
25
 
26
26
  # Replaces the objects content with the next page of the array if a next page exists
27
27
  def load_next_page!
28
- if self[:@next_page].present?
29
- reload(self[:@next_page])
28
+ if self[:@next_page_url].present?
29
+ reload(self[:@next_page_url])
30
30
  true
31
31
  else
32
32
  false
@@ -35,8 +35,8 @@ module StorageRoom
35
35
 
36
36
  # Replace the Collection with the privious page of elements if there is one
37
37
  def load_previous_page!
38
- if self[:@previous_page].present?
39
- reload(self[:@previous_page])
38
+ if self[:@previous_page_url].present?
39
+ reload(self[:@previous_page_url])
40
40
  true
41
41
  else
42
42
  false
@@ -51,10 +51,10 @@ module StorageRoom
51
51
  end while(args[:reverse] == true ? load_previous_page! : load_next_page!)
52
52
  end
53
53
 
54
- # Iterate over all items with pagination
54
+ # Iterate over all resources with pagination
55
55
  def each_page_each_item(args={})
56
56
  self.each_page(args) do |page|
57
- page.items.each do |item|
57
+ page.resources.each do |item|
58
58
  yield(item)
59
59
  end
60
60
  end
@@ -1,5 +1,5 @@
1
1
  module StorageRoom
2
- # A file that is embedded in a resource
2
+ # A file that is embedded in a entry
3
3
  class File < Embedded
4
4
 
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module StorageRoom
2
- # A location with coordinates that is embedded in a resource
2
+ # A location with coordinates that is embedded in a entry
3
3
  class Location < Embedded
4
4
 
5
5
  end
@@ -4,9 +4,9 @@ module StorageRoom
4
4
  class << self
5
5
  # Create a new model with the passed attributes
6
6
  def create(attributes={})
7
- resource = new(attributes)
8
- resource.create
9
- resource
7
+ entry = new(attributes)
8
+ entry.create
9
+ entry
10
10
  end
11
11
 
12
12
  # Get all models (could be paginated)
@@ -10,8 +10,8 @@ module StorageRoom
10
10
  "#{index_path}/#{collection_id}"
11
11
  end
12
12
 
13
- def resources_path(collection_id) # :nodoc:
14
- "#{show_path(collection_id)}/resources"
13
+ def entries_path(collection_id) # :nodoc:
14
+ "#{show_path(collection_id)}/entries"
15
15
  end
16
16
 
17
17
  def json_name # :nodoc:
@@ -19,13 +19,13 @@ module StorageRoom
19
19
  end
20
20
  end
21
21
 
22
- # Load all the resources of a collection
23
- def resources
24
- Array.load(self[:@resources_url])
22
+ # Load all the entries of a collection
23
+ def entries
24
+ Array.load(self[:@entries_url])
25
25
  end
26
26
 
27
27
  # The class of the collection's objects
28
- def resource_class
28
+ def entry_class
29
29
  StorageRoom.class_for_name(self[:identifier].classify)
30
30
  end
31
31
 
@@ -1,12 +1,12 @@
1
1
  module StorageRoom
2
- class Resource < Model
2
+ class Entry < Model
3
3
  class << self
4
4
  def index_path # :nodoc:
5
- "/collections/#{collection_id}/resources"
5
+ "/collections/#{collection_id}/entries"
6
6
  end
7
7
 
8
- def show_path(resource_id) # :nodoc:
9
- "#{index_path}/#{resource_id}"
8
+ def show_path(entry_id) # :nodoc:
9
+ "#{index_path}/#{entry_id}"
10
10
  end
11
11
 
12
12
  def collection_path # :nodoc:
@@ -18,7 +18,7 @@ module StorageRoom
18
18
  end
19
19
 
20
20
  def json_name # :nodoc:
21
- 'resource'
21
+ 'entry'
22
22
  end
23
23
 
24
24
  def search_path(parameters = {}) # :nodoc:
@@ -31,7 +31,7 @@ module StorageRoom
31
31
  end
32
32
  end
33
33
 
34
- # Sets a resource with a hash from the API.
34
+ # Sets a entry with a hash from the API.
35
35
  def set_from_api(attributes)
36
36
  super(attributes)
37
37
 
@@ -46,7 +46,7 @@ module StorageRoom
46
46
  self.attributes
47
47
  end
48
48
 
49
- # The collection of a resource
49
+ # The collection of a entry
50
50
  def collection
51
51
  Collection.load(self[:@collection_url] || self.class.collection_path)
52
52
  end
data/lib/storage_room.rb CHANGED
@@ -4,7 +4,7 @@ $:.unshift(File.dirname(__FILE__)) unless
4
4
  begin; require 'rubygems'; rescue LoadError; end
5
5
 
6
6
  require 'httparty'
7
- require 'activesupport'
7
+ require 'active_support/all'
8
8
 
9
9
 
10
10
  module StorageRoom
@@ -17,10 +17,10 @@ module StorageRoom
17
17
  autoload :Model, 'storage_room/model'
18
18
  autoload :Array, 'storage_room/array'
19
19
  autoload :Field, 'storage_room/field'
20
- autoload :Embedded, 'storage_room/embedded'
20
+ autoload :Embedded, 'storage_room/embedded'
21
21
 
22
22
  autoload :Collection, 'storage_room/models/collection'
23
- autoload :Resource, 'storage_room/models/resource'
23
+ autoload :Entry, 'storage_room/models/entry'
24
24
 
25
25
  autoload :File, 'storage_room/embeddeds/file'
26
26
  autoload :Location, 'storage_room/embeddeds/location'
@@ -78,7 +78,7 @@ module StorageRoom
78
78
  elsif Object.const_defined?(name)
79
79
  name.constantize
80
80
  else
81
- klass = Class.new(Resource)
81
+ klass = Class.new(Entry)
82
82
  Object.const_set(name, klass)
83
83
 
84
84
  klass
@@ -2,7 +2,7 @@
2
2
  "collection": {
3
3
  "name": "Guidebooks",
4
4
  "@updated_at": "2010-11-05T12:55:04Z",
5
- "@resources_url": "http://api.storageroomapp.com/accounts/4c8fd48542507175aa00002f/collections/guidebooks/resources",
5
+ "@entries_url": "http://api.storageroomapp.com/accounts/4c8fd48542507175aa00002f/collections/guidebooks/entries",
6
6
  "@created_at": "2010-09-14T20:01:13Z",
7
7
  "fields": [{
8
8
  "name": "Title",
@@ -2,10 +2,10 @@
2
2
  "collections": {
3
3
  "@type": "Array",
4
4
  "@url": "http://api.storageroomapp.com/accounts/4c8fd48542507175aa00002f/collections",
5
- "items": [{
5
+ "resources": [{
6
6
  "name": "Guidebooks",
7
7
  "@updated_at": "2010-11-05T12:55:04Z",
8
- "@resources_url": "http://api.storageroomapp.com/accounts/4c8fd48542507175aa00002f/collections/guidebooks/resources",
8
+ "@entries_url": "http://api.storageroomapp.com/accounts/4c8fd48542507175aa00002f/collections/guidebooks/entries",
9
9
  "@created_at": "2010-09-14T20:01:13Z",
10
10
  "fields": [{
11
11
  "name": "Title",
@@ -17,14 +17,14 @@ describe StorageRoom::Array do
17
17
  end
18
18
 
19
19
  describe "#initialize" do
20
- it "should set items" do
21
- @array.items.should == []
20
+ it "should set resources" do
21
+ @array.resources.should == []
22
22
  end
23
23
  end
24
24
 
25
25
  describe "#set_from_api" do
26
26
  before(:each) do
27
- @hash = {'@page' => 1, 'items' => [{'one' => 1, '@type' => 'Guidebook'}, {'two' => 2, '@type' => 'Guidebook'}]}
27
+ @hash = {'@page' => 1, 'resources' => [{'one' => 1, '@type' => 'Guidebook'}, {'two' => 2, '@type' => 'Guidebook'}]}
28
28
  @array.set_from_api(@hash)
29
29
  end
30
30
 
@@ -32,19 +32,19 @@ describe StorageRoom::Array do
32
32
  @array['@page'].should == 1
33
33
  end
34
34
 
35
- it "should set items" do
36
- @array.items.should have(2).items
37
- @array.items[0].should be_an_instance_of(Guidebook)
38
- @array.items[0][:one].should == 1
39
- @array.items[1].should be_an_instance_of(Guidebook)
40
- @array.items[1][:two].should == 2
35
+ it "should set resources" do
36
+ @array.resources.should have(2).items
37
+ @array.resources[0].should be_an_instance_of(Guidebook)
38
+ @array.resources[0][:one].should == 1
39
+ @array.resources[1].should be_an_instance_of(Guidebook)
40
+ @array.resources[1][:two].should == 2
41
41
  end
42
42
  end
43
43
 
44
44
  describe "#reset!" do
45
45
  it "should reset" do
46
46
  @array.reset!
47
- @array.items.should == []
47
+ @array.resources.should == []
48
48
  end
49
49
  end
50
50
 
@@ -54,7 +54,7 @@ describe StorageRoom::Array do
54
54
  end
55
55
 
56
56
  it "should load when present" do
57
- @array[:@next_page] = "url"
57
+ @array[:@next_page_url] = "url"
58
58
  @array.stub(:reload)
59
59
  @array.should_receive(:reload)
60
60
  @array.load_next_page!.should be_true
@@ -67,7 +67,7 @@ describe StorageRoom::Array do
67
67
  end
68
68
 
69
69
  it "should load when present" do
70
- @array[:@previous_page] = "url"
70
+ @array[:@previous_page_url] = "url"
71
71
  @array.stub(:reload)
72
72
  @array.should_receive(:reload)
73
73
  @array.load_previous_page!.should be_true
@@ -60,7 +60,7 @@ describe StorageRoom::Base do
60
60
 
61
61
  describe "#create_from_api" do
62
62
  it "should create array" do
63
- hash = {'@type' => 'Array', 'items' => []}
63
+ hash = {'@type' => 'Array', 'resources' => []}
64
64
  result = StorageRoom::Base.create_from_api(hash)
65
65
  result.should be_an_instance_of(StorageRoom::Array)
66
66
  result[:@type].should == 'Array'
@@ -73,7 +73,7 @@ describe StorageRoom::Base do
73
73
  result[:name].should == 'Guidebook'
74
74
  end
75
75
 
76
- it "should create resource" do
76
+ it "should create entry" do
77
77
  hash = {'@type' => 'Guidebook', 'title' => 'Something'}
78
78
  result = StorageRoom::Base.create_from_api(hash)
79
79
  result.should be_an_instance_of(Guidebook)
@@ -154,11 +154,11 @@ describe StorageRoom::Model do
154
154
 
155
155
  describe "#as_json" do
156
156
  it "should return hash without meta data" do
157
- resource = StorageRoom::Resource.new(:field => 1, :@attr => 2)
158
- hash = resource.as_json
157
+ entry = StorageRoom::Entry.new(:field => 1, :@attr => 2)
158
+ hash = entry.as_json
159
159
 
160
- hash['resource'][:field].should == 1
161
- hash['resource'][:@attr].should_not be_present
160
+ hash['entry'][:field].should == 1
161
+ hash['entry'][:@attr].should_not be_present
162
162
  end
163
163
  end
164
164
 
@@ -178,7 +178,7 @@ describe StorageRoom::Model do
178
178
  klass = StorageRoom.class_for_name('Guidebook')
179
179
  guidebook = klass.new
180
180
 
181
- stub_request(:post, stub_url('/collections/guidebooks/resources')).to_return(:body => fixture_file('collection.json'), :status => 200)
181
+ stub_request(:post, stub_url('/collections/guidebooks/entries')).to_return(:body => fixture_file('collection.json'), :status => 200)
182
182
 
183
183
  guidebook.create
184
184
  guidebook[:name].should == 'Guidebooks'
@@ -188,7 +188,7 @@ describe StorageRoom::Model do
188
188
  klass = StorageRoom.class_for_name('Guidebook')
189
189
  guidebook = klass.new
190
190
 
191
- stub_request(:post, stub_url('/collections/guidebooks/resources')).to_return(:body => fixture_file('validation_error.json'), :status => 422)
191
+ stub_request(:post, stub_url('/collections/guidebooks/entries')).to_return(:body => fixture_file('validation_error.json'), :status => 422)
192
192
 
193
193
  guidebook.create
194
194
  guidebook[:name].should be_nil
@@ -15,9 +15,9 @@ describe StorageRoom::Collection do
15
15
  end
16
16
  end
17
17
 
18
- describe "#resources_path" do
18
+ describe "#entries_path" do
19
19
  it "should be defined" do
20
- StorageRoom::Collection.resources_path(1).should == '/collections/1/resources'
20
+ StorageRoom::Collection.entries_path(1).should == '/collections/1/entries'
21
21
  end
22
22
  end
23
23
 
@@ -35,17 +35,17 @@ describe StorageRoom::Collection do
35
35
  @collection = StorageRoom::Collection.new
36
36
  end
37
37
 
38
- describe "#resources" do
38
+ describe "#entries" do
39
39
  it "should load" do
40
40
  StorageRoom::Array.should_receive(:load)
41
- @collection.resources
41
+ @collection.entries
42
42
  end
43
43
  end
44
44
 
45
- describe "#resource_class" do
45
+ describe "#entry_class" do
46
46
  it "should return class" do
47
47
  @collection[:identifier] = 'guidebook'
48
- klass = @collection.resource_class
48
+ klass = @collection.entry_class
49
49
  klass.should == Guidebook
50
50
  end
51
51
  end
@@ -1,6 +1,6 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
2
 
3
- describe StorageRoom::Resource do
3
+ describe StorageRoom::Entry do
4
4
  context "Class" do
5
5
  context "Methods" do
6
6
  before(:each) do
@@ -9,13 +9,13 @@ describe StorageRoom::Resource do
9
9
 
10
10
  describe "#show_path" do
11
11
  it "should be defined" do
12
- Guidebook.show_path(1).should == '/collections/guidebooks/resources/1'
12
+ Guidebook.show_path(1).should == '/collections/guidebooks/entries/1'
13
13
  end
14
14
  end
15
15
 
16
16
  describe "#index_path" do
17
17
  it "should be defined" do
18
- Guidebook.index_path.should == '/collections/guidebooks/resources'
18
+ Guidebook.index_path.should == '/collections/guidebooks/entries'
19
19
  end
20
20
  end
21
21
 
@@ -27,14 +27,14 @@ describe StorageRoom::Resource do
27
27
 
28
28
  describe "#search_path" do
29
29
  it "should be defined" do
30
- Guidebook.search_path(:test =>1).should == '/collections/guidebooks/resources?test=1'
30
+ Guidebook.search_path(:test =>1).should == '/collections/guidebooks/entries?test=1'
31
31
  end
32
32
  end
33
33
 
34
34
  describe "#json_name" do
35
35
  it "should be defined" do
36
- StorageRoom::Resource.json_name.should == 'resource'
37
- Guidebook.json_name.should == 'resource'
36
+ StorageRoom::Entry.json_name.should == 'entry'
37
+ Guidebook.json_name.should == 'entry'
38
38
  end
39
39
  end
40
40
 
@@ -55,13 +55,13 @@ describe StorageRoom::Resource do
55
55
 
56
56
  context "Instance" do
57
57
  before(:each) do
58
- @resource = StorageRoom::Resource.new
58
+ @entry = StorageRoom::Entry.new
59
59
  end
60
60
 
61
61
  describe "#collection" do
62
62
  it "should load" do
63
63
  StorageRoom::Collection.should_receive(:load)
64
- @resource.collection
64
+ @entry.collection
65
65
  end
66
66
  end
67
67
  end
@@ -91,9 +91,9 @@ describe StorageRoom do
91
91
  end
92
92
 
93
93
  it "should get StorageRoom class" do
94
- klass = StorageRoom.class_for_name('Resource')
94
+ klass = StorageRoom.class_for_name('Entry')
95
95
  klass.should be_an_instance_of(Class)
96
- klass.should == StorageRoom::Resource
96
+ klass.should == StorageRoom::Entry
97
97
  end
98
98
  end
99
99
  end
data/storage_room.gemspec CHANGED
@@ -1,91 +1,89 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{storage_room}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Sascha Konietzke"]
12
- s.date = %q{2010-11-08}
12
+ s.date = %q{2010-12-27}
13
13
  s.description = %q{StorageRoom is a CMS system for Mobile Applications (iPhone, Android, BlackBerry, ...). This library gives you an ActiveModel-like interface to your data.}
14
14
  s.email = %q{sascha@thriventures.com}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
- "README.rdoc",
18
- "TODO"
17
+ "README.rdoc",
18
+ "TODO"
19
19
  ]
20
20
  s.files = [
21
- ".gitignore",
22
- "History.txt",
23
- "LICENSE",
24
- "README.rdoc",
25
- "Rakefile",
26
- "TODO",
27
- "VERSION",
28
- "examples/authentication.rb",
29
- "examples/create_resource.rb",
30
- "examples/destroy_resource.rb",
31
- "examples/get_collections.rb",
32
- "examples/guidebooks.csv",
33
- "examples/import_csv.rb",
34
- "examples/search_resources.rb",
35
- "examples/update_resource.rb",
36
- "lib/storage_room.rb",
37
- "lib/storage_room/array.rb",
38
- "lib/storage_room/attributes.rb",
39
- "lib/storage_room/base.rb",
40
- "lib/storage_room/embedded.rb",
41
- "lib/storage_room/embeddeds/file.rb",
42
- "lib/storage_room/embeddeds/location.rb",
43
- "lib/storage_room/field.rb",
44
- "lib/storage_room/model.rb",
45
- "lib/storage_room/models/collection.rb",
46
- "lib/storage_room/models/resource.rb",
47
- "spec/fixtures/collection.json",
48
- "spec/fixtures/collections.json",
49
- "spec/fixtures/validation_error.json",
50
- "spec/spec_helper.rb",
51
- "spec/storage_room/array_spec.rb",
52
- "spec/storage_room/attributes_spec.rb",
53
- "spec/storage_room/base_spec.rb",
54
- "spec/storage_room/embedded_spec.rb",
55
- "spec/storage_room/embeddeds/file_spec.rb",
56
- "spec/storage_room/embeddeds/location_spec.rb",
57
- "spec/storage_room/field_spec.rb",
58
- "spec/storage_room/model_spec.rb",
59
- "spec/storage_room/models/collection_spec.rb",
60
- "spec/storage_room/models/resource_spec.rb",
61
- "spec/storage_room_spec.rb",
62
- "storage_room.gemspec"
21
+ "History.txt",
22
+ "LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "TODO",
26
+ "VERSION",
27
+ "examples/authentication.rb",
28
+ "examples/create_entry.rb",
29
+ "examples/destroy_entry.rb",
30
+ "examples/get_collections.rb",
31
+ "examples/guidebooks.csv",
32
+ "examples/import_csv.rb",
33
+ "examples/search_entries.rb",
34
+ "examples/update_entry.rb",
35
+ "lib/storage_room.rb",
36
+ "lib/storage_room/array.rb",
37
+ "lib/storage_room/attributes.rb",
38
+ "lib/storage_room/base.rb",
39
+ "lib/storage_room/embedded.rb",
40
+ "lib/storage_room/embeddeds/file.rb",
41
+ "lib/storage_room/embeddeds/location.rb",
42
+ "lib/storage_room/field.rb",
43
+ "lib/storage_room/model.rb",
44
+ "lib/storage_room/models/collection.rb",
45
+ "lib/storage_room/models/entry.rb",
46
+ "spec/fixtures/collection.json",
47
+ "spec/fixtures/collections.json",
48
+ "spec/fixtures/validation_error.json",
49
+ "spec/spec_helper.rb",
50
+ "spec/storage_room/array_spec.rb",
51
+ "spec/storage_room/attributes_spec.rb",
52
+ "spec/storage_room/base_spec.rb",
53
+ "spec/storage_room/embedded_spec.rb",
54
+ "spec/storage_room/embeddeds/file_spec.rb",
55
+ "spec/storage_room/embeddeds/location_spec.rb",
56
+ "spec/storage_room/field_spec.rb",
57
+ "spec/storage_room/model_spec.rb",
58
+ "spec/storage_room/models/collection_spec.rb",
59
+ "spec/storage_room/models/entry_spec.rb",
60
+ "spec/storage_room_spec.rb",
61
+ "storage_room.gemspec"
63
62
  ]
64
63
  s.homepage = %q{http://github.com/thriventures/storage_room_gem}
65
- s.rdoc_options = ["--charset=UTF-8"]
66
64
  s.require_paths = ["lib"]
67
65
  s.rubygems_version = %q{1.3.7}
68
66
  s.summary = %q{StorageRoom API Wrapper (ActiveModel style)}
69
67
  s.test_files = [
68
+ "examples/authentication.rb",
69
+ "examples/create_entry.rb",
70
+ "examples/destroy_entry.rb",
71
+ "examples/get_collections.rb",
72
+ "examples/import_csv.rb",
73
+ "examples/search_entries.rb",
74
+ "examples/update_entry.rb",
70
75
  "spec/spec_helper.rb",
71
- "spec/storage_room/array_spec.rb",
72
- "spec/storage_room/attributes_spec.rb",
73
- "spec/storage_room/base_spec.rb",
74
- "spec/storage_room/embedded_spec.rb",
75
- "spec/storage_room/embeddeds/file_spec.rb",
76
- "spec/storage_room/embeddeds/location_spec.rb",
77
- "spec/storage_room/field_spec.rb",
78
- "spec/storage_room/model_spec.rb",
79
- "spec/storage_room/models/collection_spec.rb",
80
- "spec/storage_room/models/resource_spec.rb",
81
- "spec/storage_room_spec.rb",
82
- "examples/authentication.rb",
83
- "examples/create_resource.rb",
84
- "examples/destroy_resource.rb",
85
- "examples/get_collections.rb",
86
- "examples/import_csv.rb",
87
- "examples/search_resources.rb",
88
- "examples/update_resource.rb"
76
+ "spec/storage_room/array_spec.rb",
77
+ "spec/storage_room/attributes_spec.rb",
78
+ "spec/storage_room/base_spec.rb",
79
+ "spec/storage_room/embedded_spec.rb",
80
+ "spec/storage_room/embeddeds/file_spec.rb",
81
+ "spec/storage_room/embeddeds/location_spec.rb",
82
+ "spec/storage_room/field_spec.rb",
83
+ "spec/storage_room/model_spec.rb",
84
+ "spec/storage_room/models/collection_spec.rb",
85
+ "spec/storage_room/models/entry_spec.rb",
86
+ "spec/storage_room_spec.rb"
89
87
  ]
90
88
 
91
89
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: storage_room
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sascha Konietzke
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-08 00:00:00 +01:00
18
+ date: 2010-12-27 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -91,7 +91,6 @@ extra_rdoc_files:
91
91
  - README.rdoc
92
92
  - TODO
93
93
  files:
94
- - .gitignore
95
94
  - History.txt
96
95
  - LICENSE
97
96
  - README.rdoc
@@ -99,13 +98,13 @@ files:
99
98
  - TODO
100
99
  - VERSION
101
100
  - examples/authentication.rb
102
- - examples/create_resource.rb
103
- - examples/destroy_resource.rb
101
+ - examples/create_entry.rb
102
+ - examples/destroy_entry.rb
104
103
  - examples/get_collections.rb
105
104
  - examples/guidebooks.csv
106
105
  - examples/import_csv.rb
107
- - examples/search_resources.rb
108
- - examples/update_resource.rb
106
+ - examples/search_entries.rb
107
+ - examples/update_entry.rb
109
108
  - lib/storage_room.rb
110
109
  - lib/storage_room/array.rb
111
110
  - lib/storage_room/attributes.rb
@@ -116,7 +115,7 @@ files:
116
115
  - lib/storage_room/field.rb
117
116
  - lib/storage_room/model.rb
118
117
  - lib/storage_room/models/collection.rb
119
- - lib/storage_room/models/resource.rb
118
+ - lib/storage_room/models/entry.rb
120
119
  - spec/fixtures/collection.json
121
120
  - spec/fixtures/collections.json
122
121
  - spec/fixtures/validation_error.json
@@ -130,7 +129,7 @@ files:
130
129
  - spec/storage_room/field_spec.rb
131
130
  - spec/storage_room/model_spec.rb
132
131
  - spec/storage_room/models/collection_spec.rb
133
- - spec/storage_room/models/resource_spec.rb
132
+ - spec/storage_room/models/entry_spec.rb
134
133
  - spec/storage_room_spec.rb
135
134
  - storage_room.gemspec
136
135
  has_rdoc: true
@@ -138,8 +137,8 @@ homepage: http://github.com/thriventures/storage_room_gem
138
137
  licenses: []
139
138
 
140
139
  post_install_message:
141
- rdoc_options:
142
- - --charset=UTF-8
140
+ rdoc_options: []
141
+
143
142
  require_paths:
144
143
  - lib
145
144
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -168,6 +167,13 @@ signing_key:
168
167
  specification_version: 3
169
168
  summary: StorageRoom API Wrapper (ActiveModel style)
170
169
  test_files:
170
+ - examples/authentication.rb
171
+ - examples/create_entry.rb
172
+ - examples/destroy_entry.rb
173
+ - examples/get_collections.rb
174
+ - examples/import_csv.rb
175
+ - examples/search_entries.rb
176
+ - examples/update_entry.rb
171
177
  - spec/spec_helper.rb
172
178
  - spec/storage_room/array_spec.rb
173
179
  - spec/storage_room/attributes_spec.rb
@@ -178,12 +184,5 @@ test_files:
178
184
  - spec/storage_room/field_spec.rb
179
185
  - spec/storage_room/model_spec.rb
180
186
  - spec/storage_room/models/collection_spec.rb
181
- - spec/storage_room/models/resource_spec.rb
187
+ - spec/storage_room/models/entry_spec.rb
182
188
  - spec/storage_room_spec.rb
183
- - examples/authentication.rb
184
- - examples/create_resource.rb
185
- - examples/destroy_resource.rb
186
- - examples/get_collections.rb
187
- - examples/import_csv.rb
188
- - examples/search_resources.rb
189
- - examples/update_resource.rb
data/.gitignore DELETED
@@ -1,22 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
20
-
21
- ## PROJECT::SPECIFIC
22
- lib/irb.rb
@@ -1,24 +0,0 @@
1
- #!/usr/bin/env ruby -rubygems
2
-
3
- require File.dirname(__FILE__) + '/authentication'
4
-
5
- # create a resource without fetching the collection
6
- klass = StorageRoom.class_for_name('Guidebook')
7
- resource1 = klass.new(:name => 'Foo', :price => 1.23)
8
-
9
- if resource1.save
10
- puts "Resource saved"
11
- else
12
- puts "Resource could not be saved: #{resource1.errors.join(', ')}"
13
- end
14
-
15
- # fetch the collection first
16
- collection = StorageRoom::Collection.find('guidebooks')
17
-
18
- resource2 = collection.resource_class.new(:name => 'Bar', :price => 2.23)
19
-
20
- if resource2.save
21
- puts "Resource saved"
22
- else
23
- puts "Resource could not be saved: #{resource2.errors.join(', ')}"
24
- end
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby -rubygems
2
-
3
- require File.dirname(__FILE__) + '/authentication'
4
-
5
- collection = StorageRoom::Collection.find('guidebooks')
6
-
7
- resources = collection.resource_class.search(:name => 'Bar')
8
-
9
- puts "Resources with name 'Bar':"
10
-
11
- resources.items.each do |resource|
12
- puts "- #{resource[:name]}"
13
- end
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env ruby -rubygems
2
-
3
- require File.dirname(__FILE__) + '/authentication'
4
-
5
- collection = StorageRoom::Collection.find('guidebooks')
6
-
7
- resource = collection.resources.items.first
8
-
9
- resource[:name] = 'Foobar'
10
-
11
- if resource.save
12
- puts "Resource saved"
13
- else
14
- puts "Resource could not be saved: #{resource.errors.join(', ')}"
15
- end