restpack_core_service 0.0.2

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 22f114dcdcd1b68e603a2e20358ffa6ac3ea4746
4
+ data.tar.gz: 9181b1eecda13ef3a1d4c0bfd913c12ea8af5db2
5
+ SHA512:
6
+ metadata.gz: 7a201ac987e6e126744d91b1ba50920cf15706876feecb6fb8c914471bf448f3c512fb240507ff33705daf2e958f3dca18717fff26886ca3710fe83fdaacac07
7
+ data.tar.gz: 0cc81351fdb07beb6f7d7c87fbca4ac8741e79c1a523fc5100c05d5e848f6b63f180d226b8b7b21004b99fa804bbfc61665b04b2b099737dfc33a8eaaf9ae122
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in restpack_core_service.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Gavin Joyce
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # RestpackCoreService
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'restpack_core_service'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install restpack_core_service
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ require "restpack_gem"
2
+ require "active_support/inflector"
3
+
4
+ RestPack::Gem::Tasks.load_service_tasks
@@ -0,0 +1,8 @@
1
+ test:
2
+ adapter: postgresql
3
+ host: localhost
4
+ encoding: utf8
5
+ database: restpack_core_service_test
6
+ pool: 5
7
+ username:
8
+ password:
@@ -0,0 +1,10 @@
1
+ class CreateApplications < ActiveRecord::Migration
2
+ def change
3
+ create_table :applications do |t|
4
+ t.string :name, :null => false, :limit => 256
5
+ t.integer :account_id, :null => false
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ class CreateDomains < ActiveRecord::Migration
2
+ def change
3
+ create_table :domains do |t|
4
+ t.string :host, :null => false, :limit => 512
5
+ t.integer :application_id, :null => false
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,8 @@
1
+ require "restpack_service"
2
+ require "active_support/core_ext"
3
+
4
+ require "restpack_core_service/version"
5
+ require "restpack_core_service/configuration"
6
+
7
+ require "restpack_core_service/models/application"
8
+ require "restpack_core_service/models/domain"
@@ -0,0 +1,12 @@
1
+ module RestPack::Core::Service
2
+ class Configuration < RestPack::Service::Configuration
3
+
4
+ end
5
+
6
+ mattr_accessor :config
7
+ @@config = Configuration.new
8
+
9
+ def self.setup
10
+ yield @@config
11
+ end
12
+ end
@@ -0,0 +1,10 @@
1
+ module RestPack::Models
2
+ class Application < ActiveRecord::Base
3
+ attr_accessible :name, :account_id
4
+
5
+ validates_presence_of :name, :account_id
6
+ validates :name, :length => { :maximum => 256 }
7
+
8
+ has_many :domains
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module RestPack::Models
2
+ class Domain < ActiveRecord::Base
3
+ attr_accessible :host, :application
4
+
5
+ validates_presence_of :host
6
+ validates :host, :length => { :maximum => 512 }
7
+
8
+ belongs_to :application
9
+ end
10
+ end
@@ -0,0 +1,7 @@
1
+ module RestPack
2
+ module Core
3
+ module Service
4
+ VERSION = "0.0.2"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,33 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'restpack_core_service/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "restpack_core_service"
8
+ spec.version = RestPack::Core::Service::VERSION
9
+ spec.authors = ["Gavin Joyce"]
10
+ spec.email = ["gavinjoyce@gmail.com"]
11
+ spec.description = %q{Applications, Domains and Configurations service}
12
+ spec.summary = %q{Applications, Domains and Configurations}
13
+ spec.homepage = "https://github.com/RestPack"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "restpack_service", "~> 0.0.28"
22
+ spec.add_dependency "restpack_serializer", "~> 0.4.1"
23
+ spec.add_dependency "restpack_gem", "~> 0.0.11"
24
+ spec.add_dependency "sinatra", "~> 1.4.3"
25
+ spec.add_dependency "pg", "~> 0.16"
26
+
27
+ spec.add_development_dependency "bundler", "~> 1.3"
28
+ spec.add_development_dependency "database_cleaner", "~> 1.0.1"
29
+ spec.add_development_dependency "rake"
30
+ spec.add_development_dependency "rspec"
31
+ spec.add_development_dependency "bump"
32
+ spec.add_development_dependency "shoulda-matchers", "~> 1.4.2"
33
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe RestPack::Core::Service::Configuration do
4
+ it "has a default table prefix" do
5
+ RestPack::Core::Service.config.db_table_prefix.should == "restpack_"
6
+ end
7
+ end
@@ -0,0 +1,6 @@
1
+ describe RestPack::Models::Application do
2
+ it { should validate_presence_of(:name) }
3
+ it { should validate_presence_of(:account_id) }
4
+ it { should ensure_length_of(:name).is_at_most(256) }
5
+ it { should have_many(:domains) }
6
+ end
@@ -0,0 +1,5 @@
1
+ describe RestPack::Models::Domain do
2
+ it { should validate_presence_of(:host) }
3
+ it { should ensure_length_of(:host).is_at_most(512) }
4
+ it { should belong_to(:application) }
5
+ end
@@ -0,0 +1,25 @@
1
+ require 'active_record'
2
+ require 'rspec'
3
+ require 'database_cleaner'
4
+ require 'yaml'
5
+ require 'shoulda-matchers'
6
+ require 'restpack_core_service'
7
+
8
+ config = YAML.load_file('./config/database.yml')
9
+ ActiveRecord::Base.establish_connection(ENV['DATABASE_URL'] || config['test'])
10
+
11
+ migrations_path = File.dirname(__FILE__) + "/../db/migrate"
12
+ migrator = ActiveRecord::Migrator.new(:up, migrations_path)
13
+ migrator.migrate
14
+
15
+ DatabaseCleaner.strategy = :transaction
16
+
17
+ RSpec.configure do |config|
18
+ config.before(:each) do
19
+ DatabaseCleaner.start
20
+ end
21
+
22
+ config.after(:each) do
23
+ DatabaseCleaner.clean
24
+ end
25
+ end
metadata ADDED
@@ -0,0 +1,221 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: restpack_core_service
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Gavin Joyce
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-08-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: restpack_service
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 0.0.28
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 0.0.28
27
+ - !ruby/object:Gem::Dependency
28
+ name: restpack_serializer
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 0.4.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 0.4.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: restpack_gem
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 0.0.11
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 0.0.11
55
+ - !ruby/object:Gem::Dependency
56
+ name: sinatra
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 1.4.3
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 1.4.3
69
+ - !ruby/object:Gem::Dependency
70
+ name: pg
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: '0.16'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '0.16'
83
+ - !ruby/object:Gem::Dependency
84
+ name: bundler
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: '1.3'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: '1.3'
97
+ - !ruby/object:Gem::Dependency
98
+ name: database_cleaner
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ version: 1.0.1
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ version: 1.0.1
111
+ - !ruby/object:Gem::Dependency
112
+ name: rake
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rspec
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: bump
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: shoulda-matchers
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ~>
158
+ - !ruby/object:Gem::Version
159
+ version: 1.4.2
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ~>
165
+ - !ruby/object:Gem::Version
166
+ version: 1.4.2
167
+ description: Applications, Domains and Configurations service
168
+ email:
169
+ - gavinjoyce@gmail.com
170
+ executables: []
171
+ extensions: []
172
+ extra_rdoc_files: []
173
+ files:
174
+ - .gitignore
175
+ - .rspec
176
+ - Gemfile
177
+ - LICENSE.txt
178
+ - README.md
179
+ - Rakefile
180
+ - config/database.yml
181
+ - db/migrate/20130807103945_create_applications.rb
182
+ - db/migrate/20130807104142_create_domains.rb
183
+ - lib/restpack_core_service.rb
184
+ - lib/restpack_core_service/configuration.rb
185
+ - lib/restpack_core_service/models/application.rb
186
+ - lib/restpack_core_service/models/domain.rb
187
+ - lib/restpack_core_service/version.rb
188
+ - restpack_core_service.gemspec
189
+ - spec/configuration_spec.rb
190
+ - spec/models/application_spec.rb
191
+ - spec/models/domain_spec.rb
192
+ - spec/spec_helper.rb
193
+ homepage: https://github.com/RestPack
194
+ licenses:
195
+ - MIT
196
+ metadata: {}
197
+ post_install_message:
198
+ rdoc_options: []
199
+ require_paths:
200
+ - lib
201
+ required_ruby_version: !ruby/object:Gem::Requirement
202
+ requirements:
203
+ - - '>='
204
+ - !ruby/object:Gem::Version
205
+ version: '0'
206
+ required_rubygems_version: !ruby/object:Gem::Requirement
207
+ requirements:
208
+ - - '>='
209
+ - !ruby/object:Gem::Version
210
+ version: '0'
211
+ requirements: []
212
+ rubyforge_project:
213
+ rubygems_version: 2.0.3
214
+ signing_key:
215
+ specification_version: 4
216
+ summary: Applications, Domains and Configurations
217
+ test_files:
218
+ - spec/configuration_spec.rb
219
+ - spec/models/application_spec.rb
220
+ - spec/models/domain_spec.rb
221
+ - spec/spec_helper.rb