Skip to content

Commit 40509ed

Browse files
committed
Initial commit
1 parent d29e47a commit 40509ed

12 files changed

Lines changed: 133 additions & 12 deletions

File tree

.gitignore

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
11
*.gem
2-
*.rbc
2+
*.idea
33
.bundle
4-
.config
5-
coverage
6-
InstalledFiles
7-
lib/bundler/man
8-
pkg
9-
rdoc
10-
spec/reports
11-
test/tmp
12-
test/version_tmp
134
tmp
14-
15-
# YARD artifacts
165
.yardoc
176
_yardoc
187
doc/

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Overview
2+
3+
## 0.0.1 [In progress]
4+
5+

Gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
source "http://rubygems.org"
2+
gemspec
3+
4+
gem "rake"
5+
6+
platforms :jruby do
7+
gem "jruby-openssl"
8+
end

Guardfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
guard("rspec", :all_after_pass => false, :cli => "--fail-fast --color") do
2+
watch(%r{^spec/.+_spec\.rb$})
3+
watch(%r{^lib/(.+)\.rb$}) {|match| "spec/#{match[1]}_spec.rb"}
4+
end

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2011 Placester, Inc
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

Rakefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
require "bundler"
2+
Bundler.setup
3+
4+
require "rake"
5+
require "rspec"
6+
require "rspec/core/rake_task"
7+
8+
RSpec::Core::RakeTask.new("spec") do |spec|
9+
spec.pattern = "spec/**/*_spec.rb"
10+
end
11+
12+
task :default => :spec

lib/ruby-smugmug.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
path = File.expand_path("../smugmug", __FILE__)
2+
require "#{path}/version"
3+
require "#{path}/exceptions"

lib/smugmug/exceptions.rb

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module SmugMug
2+
##
3+
# Generic module that provides access to the code and text separately of the exception
4+
module ReplyErrors
5+
attr_reader :reply_text, :reply_code
6+
7+
def initialize(msg, reply_code=nil, reply_text=nil)
8+
super(msg)
9+
@reply_code, @reply_text = reply_code, reply_text
10+
end
11+
end
12+
13+
##
14+
#
15+
class OAuthError < StandardError
16+
include ReplyErrors
17+
end
18+
19+
##
20+
# HTTP errors
21+
class HTTPError < StandardError
22+
include ReplyErrors
23+
end
24+
25+
##
26+
# Error with doing that due to permissions (Trying to write with a read only key)
27+
class PermissionError < StandardError
28+
include ReplyErrors
29+
30+
end
31+
end

lib/smugmug/version.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module SmugMug
2+
VERSION = "0.0.1"
3+
end

ruby-smugmug.gemspec

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
2+
require "smugmug/version.rb"
3+
4+
Gem::Specification.new do |s|
5+
s.name = "ruby-smugmug"
6+
s.version = SmugMug::VERSION
7+
s.platform = Gem::Platform::RUBY
8+
s.authors = ["Zachary Anker"]
9+
s.email = ["zach.anker@gmail.com"]
10+
s.homepage = "http://github.com/zanker/ruby-smugmug"
11+
s.summary = "SmugMug 1.3.0 API gem"
12+
s.description = "Gem for reading and writing data from the SmugMug 1.3.0 API."
13+
14+
s.required_rubygems_version = ">= 1.3.6"
15+
s.rubyforge_project = "ruby-smugmug"
16+
17+
s.add_development_dependency "rspec", "~>2.8.0"
18+
s.add_development_dependency "guard-rspec", "~>0.6.0"
19+
20+
s.files = Dir.glob("lib/**/*") + %w[LICENSE README.md CHANGELOG.md Rakefile]
21+
s.require_path = "lib"
22+
end

0 commit comments

Comments
 (0)