storage_room 0.1.3 → 0.1.4
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/VERSION +1 -1
- data/examples/authentication.rb +2 -2
- data/examples/create_entry.rb +2 -2
- data/examples/import_csv.rb +2 -2
- data/examples/search_entries.rb +3 -3
- data/examples/update_entry.rb +1 -1
- data/storage_room.gemspec +2 -2
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/examples/authentication.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../lib/storage_room'
|
2
2
|
|
3
|
-
ACCOUNT_ID = '
|
4
|
-
APPLICATION_API_KEY = '
|
3
|
+
ACCOUNT_ID = '4cef9a8c425071fa6900002f' # your account id
|
4
|
+
APPLICATION_API_KEY = 'c499kx9L6aBfvJlvSKbF' # your application's API key with read/write access
|
5
5
|
|
6
6
|
StorageRoom.authenticate(ACCOUNT_ID, APPLICATION_API_KEY)
|
data/examples/create_entry.rb
CHANGED
@@ -4,7 +4,7 @@ require File.dirname(__FILE__) + '/authentication'
|
|
4
4
|
|
5
5
|
# create a entry without fetching the collection
|
6
6
|
klass = StorageRoom.class_for_name('Guidebook')
|
7
|
-
entry1 = klass.new(:
|
7
|
+
entry1 = klass.new(:title => 'Foo', :price => 1.23)
|
8
8
|
|
9
9
|
if entry1.save
|
10
10
|
puts "Entry saved"
|
@@ -15,7 +15,7 @@ end
|
|
15
15
|
# fetch the collection first
|
16
16
|
collection = StorageRoom::Collection.find('guidebooks')
|
17
17
|
|
18
|
-
entry2 = collection.entry_class.new(:
|
18
|
+
entry2 = collection.entry_class.new(:title => 'Bar', :price => 2.23)
|
19
19
|
|
20
20
|
if entry2.save
|
21
21
|
puts "Entry saved"
|
data/examples/import_csv.rb
CHANGED
@@ -11,10 +11,10 @@ lines.slice!(0) # remove header line
|
|
11
11
|
klass = StorageRoom.class_for_name('Guidebook')
|
12
12
|
|
13
13
|
lines.each do |row|
|
14
|
-
guidebook = klass.new(:
|
14
|
+
guidebook = klass.new(:title => row[0], :price => row[1].to_f)
|
15
15
|
|
16
16
|
if guidebook.save
|
17
|
-
puts "Guidebook saved: #{guidebook[:
|
17
|
+
puts "Guidebook saved: #{guidebook[:title]}, #{guidebook[:price]}"
|
18
18
|
else
|
19
19
|
puts "Guidebook could not be saved: #{guidebook.errors.join(', ')}"
|
20
20
|
end
|
data/examples/search_entries.rb
CHANGED
@@ -4,10 +4,10 @@ require File.dirname(__FILE__) + '/authentication'
|
|
4
4
|
|
5
5
|
collection = StorageRoom::Collection.find('guidebooks')
|
6
6
|
|
7
|
-
entries = collection.entry_class.search(:
|
7
|
+
entries = collection.entry_class.search(:title => 'Name 2')
|
8
8
|
|
9
|
-
puts "Entries with
|
9
|
+
puts "Entries with title 'Name 2':"
|
10
10
|
|
11
11
|
entries.resources.each do |entry|
|
12
|
-
puts "- #{entry[:
|
12
|
+
puts "- #{entry[:title]}"
|
13
13
|
end
|
data/examples/update_entry.rb
CHANGED
data/storage_room.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{storage_room}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.4"
|
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{
|
12
|
+
s.date = %q{2011-01-17}
|
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 = [
|
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:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 4
|
10
|
+
version: 0.1.4
|
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:
|
18
|
+
date: 2011-01-17 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|