grzegorzkazulak-ruby-flaker 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ == 0.0.1 2009-05-30
2
+
3
+ * 1 major enhancement:
4
+ * Initial release
@@ -0,0 +1,15 @@
1
+ History.txt
2
+ Manifest.txt
3
+ PostInstall.txt
4
+ README.rdoc
5
+ Rakefile
6
+ lib/flaker.rb
7
+ lib/flaker/base.rb
8
+ lib/flaker/wrapper.rb
9
+ script/console
10
+ script/destroy
11
+ script/generate
12
+ spec/flaker_spec.rb
13
+ spec/spec.opts
14
+ spec/spec_helper.rb
15
+ tasks/rspec.rake
@@ -0,0 +1,42 @@
1
+ flaker
2
+ =============
3
+
4
+ Flaker is a [Flaker.pl](http://flaker.pl) API wrapper written in ruby.
5
+
6
+ Installation
7
+ ------------
8
+
9
+ Like any other gem you can simply install flaker by typing into console:
10
+ $ sudo gem install grzegorzkazulak-ruby-flaker --source=http://gems.github.com
11
+
12
+ To get the most recent version (master branch) use:
13
+ $ git cone git://github.com/grzegorzkazulak/ruby-flaker.git
14
+
15
+ Examples
16
+ -------
17
+ You can find examples in "examples directory"
18
+
19
+ Authors
20
+ -------
21
+ Grzegorz Kazulak <grzegorz.kazulak@gmail.com>
22
+
23
+ License
24
+ -------
25
+ Permission is hereby granted, free of charge, to any person obtaining
26
+ a copy of this software and associated documentation files (the
27
+ "Software"), to deal in the Software without restriction, including
28
+ without limitation the rights to use, copy, modify, merge, publish,
29
+ distribute, sublicense, and/or sell copies of the Software, and to
30
+ permit persons to whom the Software is furnished to do so, subject to
31
+ the following conditions:
32
+
33
+ The above copyright notice and this permission notice shall be
34
+ included in all copies or substantial portions of the Software.
35
+
36
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
37
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
38
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
39
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
40
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
41
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
42
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,4 @@
1
+ ---
2
+ :major: 0
3
+ :minor: 1
4
+ :patch: 1
@@ -0,0 +1,20 @@
1
+ module Flaker
2
+ class Base
3
+ include HTTParty
4
+
5
+ # Initializes the object.
6
+ # Takes username and password as arguments
7
+ def initialize(user = nil, password = nil)
8
+ if user && password
9
+ self.class.basic_auth user, password
10
+ else
11
+ return false
12
+ end
13
+ end
14
+
15
+ def fetch(param, options = {})
16
+ Flaker::ObjectWrapper.new(self.class.get(Flaker::API_PATH + param))
17
+ end
18
+
19
+ end
20
+ end
@@ -0,0 +1,14 @@
1
+ module Flaker
2
+ class ObjectWrapper < Base
3
+
4
+ attr_writer :data
5
+
6
+ def initialize(hash)
7
+ @data = hash
8
+ end
9
+
10
+ def method_missing(method_name)
11
+ @data[method_name.to_s] unless @data.class == 'Hash'
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ require File.dirname(__FILE__) + '/spec_helper.rb'
2
+
3
+ # Time to add your specs!
4
+ # http://rspec.info/
5
+ describe "Place your specs here" do
6
+
7
+ it "should return object wrapper on fetch" do
8
+ flaker = Flaker::Base.new
9
+ flaker.fetch('type:user/login:dstranz/limit:2/source:photos/tag:bydgoszcz', {:source => 'photos'}).class == 'Flaker::ObjectWrapper'
10
+ end
11
+
12
+ end
@@ -0,0 +1 @@
1
+ --colour
@@ -0,0 +1,10 @@
1
+ begin
2
+ require 'spec'
3
+ rescue LoadError
4
+ require 'rubygems'
5
+ gem 'rspec'
6
+ require 'spec'
7
+ end
8
+
9
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
10
+ require 'flaker'
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: grzegorzkazulak-ruby-flaker
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Grzegorz Kazulak
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-05-31 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: mime-types
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "1.15"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: diff-lcs
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.1.2
34
+ version:
35
+ description: API wrapper for Flaker.pl written in Ruby.
36
+ email: grzegorz.kazulak@gmail.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files: []
42
+
43
+ files:
44
+ - Manifest.txt
45
+ - History.txt
46
+ - README.markdown
47
+ - VERSION.yml
48
+ - lib/flaker
49
+ - lib/flaker/base.rb
50
+ - lib/flaker/wrapper.rb
51
+ - spec/flaker_spec.rb
52
+ - spec/spec_helper.rb
53
+ - spec/spec.opts
54
+ has_rdoc: true
55
+ homepage: http://github.com/grzegorzkazulak/ruby-flaker
56
+ post_install_message:
57
+ rdoc_options:
58
+ - --inline-source
59
+ - --charset=UTF-8
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: "0"
67
+ version:
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: "0"
73
+ version:
74
+ requirements: []
75
+
76
+ rubyforge_project: ruby-flaker
77
+ rubygems_version: 1.2.0
78
+ signing_key:
79
+ specification_version: 2
80
+ summary: API wrapper for Flaker.pl written in Ruby..
81
+ test_files: []
82
+