delicious_adder 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,27 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ delicious_adder (0.1.0)
5
+ sinatra
6
+ thin
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ daemons (1.1.0)
12
+ eventmachine (0.12.10)
13
+ rack (1.2.1)
14
+ sinatra (1.0)
15
+ rack (>= 1.0)
16
+ thin (1.2.7)
17
+ daemons (>= 1.0.9)
18
+ eventmachine (>= 0.12.6)
19
+ rack (>= 1.0.0)
20
+
21
+ PLATFORMS
22
+ ruby
23
+
24
+ DEPENDENCIES
25
+ delicious_adder!
26
+ sinatra
27
+ thin
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010 Simon Jefford
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,32 @@
1
+ = delicious_adder
2
+
3
+ Provides a tiny web service so RedLaser (or a similar mobile app) can scan directly
4
+ into Delicious Library.
5
+
6
+ == Instructions for RedLaser on an iPhone.
7
+
8
+ Visit http://redlaser.com/apps on your iPhone and fill in the following fields
9
+
10
+ Name: Delicious Library Scanner
11
+
12
+ URL: http://{your_host_name_or_ip}:9292/
13
+
14
+ Param: barcode
15
+
16
+ Run the following in a Terminal window:
17
+
18
+ delicious_adder start
19
+
20
+ == Note on Patches/Pull Requests
21
+
22
+ * Fork the project.
23
+ * Make your feature addition or bug fix.
24
+ * Add tests for it. This is important so I don't break it in a
25
+ future version unintentionally.
26
+ * Commit, do not mess with rakefile, version, or history.
27
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
28
+ * Send me a pull request. Bonus points for topic branches.
29
+
30
+ == Copyright
31
+
32
+ Copyright (c) 2010 Simon Jefford. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,53 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "delicious_adder"
8
+ gem.description = %Q{Add items to Delicious Library from your mobile phone.}
9
+ gem.summary = %Q{App for adding to Delicious Library}
10
+ gem.email = "simon.jefford@gmail.com"
11
+ gem.homepage = "http://github.com/simonjefford/delicious_adder"
12
+ gem.authors = ["Simon Jefford"]
13
+ gem.add_runtime_dependency "thin"
14
+ gem.add_runtime_dependency "sinatra"
15
+ end
16
+ Jeweler::GemcutterTasks.new
17
+ rescue LoadError
18
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
19
+ end
20
+
21
+ require 'rake/testtask'
22
+ Rake::TestTask.new(:test) do |test|
23
+ test.libs << 'lib' << 'test'
24
+ test.pattern = 'test/**/test_*.rb'
25
+ test.verbose = true
26
+ end
27
+
28
+ begin
29
+ require 'rcov/rcovtask'
30
+ Rcov::RcovTask.new do |test|
31
+ test.libs << 'test'
32
+ test.pattern = 'test/**/test_*.rb'
33
+ test.verbose = true
34
+ end
35
+ rescue LoadError
36
+ task :rcov do
37
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
38
+ end
39
+ end
40
+
41
+ task :test => :check_dependencies
42
+
43
+ task :default => :test
44
+
45
+ require 'rake/rdoctask'
46
+ Rake::RDocTask.new do |rdoc|
47
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
48
+
49
+ rdoc.rdoc_dir = 'rdoc'
50
+ rdoc.title = "delicious_adder #{version}"
51
+ rdoc.rdoc_files.include('README*')
52
+ rdoc.rdoc_files.include('lib/**/*.rb')
53
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'bundler/setup'
5
+ require File.dirname(__FILE__) + '/../lib/lookup'
6
+ require 'thin'
7
+
8
+ rackup_file = "#{File.dirname(__FILE__)}/../lib/config.ru"
9
+
10
+ argv = ARGV
11
+ argv << ["-R", rackup_file] unless ARGV.include?("-R")
12
+ argv << ["-p", "9292"] unless ARGV.include?("-p")
13
+ argv << ["-e", "production"] unless ARGV.include?("-e")
14
+ puts argv.inspect
15
+ Thin::Runner.new(argv.flatten).run!
16
+
@@ -0,0 +1,55 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{delicious_adder}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Simon Jefford"]
12
+ s.date = %q{2010-09-11}
13
+ s.default_executable = %q{delicious_adder}
14
+ s.description = %q{Add items to Delicious Library from your mobile phone.}
15
+ s.email = %q{simon.jefford@gmail.com}
16
+ s.executables = ["delicious_adder"]
17
+ s.extra_rdoc_files = [
18
+ "LICENSE",
19
+ "README.rdoc"
20
+ ]
21
+ s.files = [
22
+ "Gemfile",
23
+ "Gemfile.lock",
24
+ "LICENSE",
25
+ "README.rdoc",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "bin/delicious_adder",
29
+ "delicious_adder.gemspec",
30
+ "lib/config.ru",
31
+ "lib/lookup.rb"
32
+ ]
33
+ s.homepage = %q{http://github.com/simonjefford/delicious_adder}
34
+ s.rdoc_options = ["--charset=UTF-8"]
35
+ s.require_paths = ["lib"]
36
+ s.rubygems_version = %q{1.3.7}
37
+ s.summary = %q{App for adding to Delicious Library}
38
+
39
+ if s.respond_to? :specification_version then
40
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
41
+ s.specification_version = 3
42
+
43
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
44
+ s.add_runtime_dependency(%q<thin>, [">= 0"])
45
+ s.add_runtime_dependency(%q<sinatra>, [">= 0"])
46
+ else
47
+ s.add_dependency(%q<thin>, [">= 0"])
48
+ s.add_dependency(%q<sinatra>, [">= 0"])
49
+ end
50
+ else
51
+ s.add_dependency(%q<thin>, [">= 0"])
52
+ s.add_dependency(%q<sinatra>, [">= 0"])
53
+ end
54
+ end
55
+
data/lib/config.ru ADDED
@@ -0,0 +1 @@
1
+ run Lookup
data/lib/lookup.rb ADDED
@@ -0,0 +1,17 @@
1
+ require 'sinatra'
2
+
3
+ class Lookup < Sinatra::Base
4
+ get '/' do
5
+ cmdline= <<CMDEND
6
+ tell first document of application "Delicious Library 2"
7
+ look up "#{params[:barcode]}"
8
+ end tell
9
+ CMDEND
10
+ puts cmdline
11
+ #TODO - pipe this through osascript rather than save it to a file
12
+ open("script.txt", "w") { |io| io.write(cmdline) }
13
+ system "osascript script.txt"
14
+ params[:barcode]
15
+ end
16
+ end
17
+
metadata ADDED
@@ -0,0 +1,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: delicious_adder
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 0
10
+ version: 0.1.0
11
+ platform: ruby
12
+ authors:
13
+ - Simon Jefford
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-09-11 00:00:00 +01:00
19
+ default_executable: delicious_adder
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: thin
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: sinatra
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
46
+ version: "0"
47
+ type: :runtime
48
+ version_requirements: *id002
49
+ description: Add items to Delicious Library from your mobile phone.
50
+ email: simon.jefford@gmail.com
51
+ executables:
52
+ - delicious_adder
53
+ extensions: []
54
+
55
+ extra_rdoc_files:
56
+ - LICENSE
57
+ - README.rdoc
58
+ files:
59
+ - Gemfile
60
+ - Gemfile.lock
61
+ - LICENSE
62
+ - README.rdoc
63
+ - Rakefile
64
+ - VERSION
65
+ - bin/delicious_adder
66
+ - delicious_adder.gemspec
67
+ - lib/config.ru
68
+ - lib/lookup.rb
69
+ has_rdoc: true
70
+ homepage: http://github.com/simonjefford/delicious_adder
71
+ licenses: []
72
+
73
+ post_install_message:
74
+ rdoc_options:
75
+ - --charset=UTF-8
76
+ require_paths:
77
+ - lib
78
+ required_ruby_version: !ruby/object:Gem::Requirement
79
+ none: false
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ hash: 3
84
+ segments:
85
+ - 0
86
+ version: "0"
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ hash: 3
93
+ segments:
94
+ - 0
95
+ version: "0"
96
+ requirements: []
97
+
98
+ rubyforge_project:
99
+ rubygems_version: 1.3.7
100
+ signing_key:
101
+ specification_version: 3
102
+ summary: App for adding to Delicious Library
103
+ test_files: []
104
+