Permalink
Browse files

Blinging.

  • Loading branch information...
1 parent 8a9a408 commit 606e1933ac08b383796bda086440e9ca35c66d19 @sneakin committed Sep 26, 2010
Showing with 107 additions and 23 deletions.
  1. +20 −0 LICENSE
  2. +22 −23 README.md
  3. +49 −0 Rakefile
  4. +7 −0 spec/nom_nom_spec.rb
  5. +9 −0 spec/spec_helper.rb
View
@@ -0,0 +1,20 @@
+Copyright (c) 2009 Nolan Eakins
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -18,28 +18,27 @@ Currently, NomNom can only eat sugar cookie.
Examples
---
-<code>
-require 'nom_nom'
-class Service < NomNom::Service
- resources :users
-
- class Post < NomNom::Resource
- attr_accessor :id, :body, :user_id
- belongs_to :user
- end
-
- class User < NomNom::Resource
- attr_accessor :id, :login, :email
- has_many :posts
- end
-end
-
-s = Service.new('https://example.com', 'user', 'password')
-s.users.each do |u|
- puts u.login
- puts '=' * u.login.length
- puts "\t" + u.posts.collect { |p| p.body }.join("\n\t")
-end
-</code>
+ require 'nom_nom'
+ class Service < NomNom::Service
+ resources :users
+
+ class Post < NomNom::Resource
+ attr_accessor :id, :body, :user_id
+ belongs_to :user
+ end
+
+ class User < NomNom::Resource
+ attr_accessor :id, :login, :email
+ has_many :posts
+ end
+ end
+
+ s = Service.new('https://example.com', 'user', 'password')
+ s.users.each do |u|
+ puts u.login
+ puts '=' * u.login.length
+ puts "\t" + u.posts.collect { |p| p.body }.join("\n\t")
+ end
+
More for [Bitter](http://bitter.rubyforge.org/) and [Syncd](http://www.syncd.com/) can be found in `./examples`.
View
@@ -0,0 +1,49 @@
+require 'rubygems'
+require 'rake'
+
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gem|
+ gem.name = "nom_nom"
+ gem.summary = %Q{COOKIE!!}
+ gem.description = %Q{I consume web service. Nom nom nom.}
+ gem.email = "sneakin+nomnom@semanticgap.com"
+ gem.homepage = "http://github.com/sneakin/nom_nom"
+ gem.authors = ["Nolan Eakins"]
+ gem.add_development_dependency "rspec"
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
+ end
+ Jeweler::GemcutterTasks.new
+rescue LoadError
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
+end
+
+require 'spec/rake/spectask'
+Spec::Rake::SpecTask.new(:spec) do |spec|
+ spec.libs << 'lib' << 'spec'
+ spec.spec_files = FileList['spec/**/*_spec.rb']
+end
+
+Spec::Rake::SpecTask.new(:rcov) do |spec|
+ spec.libs << 'lib' << 'spec'
+ spec.pattern = 'spec/**/*_spec.rb'
+ spec.rcov = true
+end
+
+task :spec => :check_dependencies
+
+task :default => :spec
+
+require 'rake/rdoctask'
+Rake::RDocTask.new do |rdoc|
+ if File.exist?('VERSION')
+ version = File.read('VERSION')
+ else
+ version = ""
+ end
+
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "nom_nom #{version}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
@@ -0,0 +1,7 @@
+require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
+
+describe "NomNom" do
+ it "fails" do
+ fail "hey buddy, you should probably rename this file and start specing for real"
+ end
+end
View
@@ -0,0 +1,9 @@
+$LOAD_PATH.unshift(File.dirname(__FILE__))
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+require 'nom_nom'
+require 'spec'
+require 'spec/autorun'
+
+Spec::Runner.configure do |config|
+
+end

0 comments on commit 606e193

Please sign in to comment.