contracto 0.0.1

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: 918a5cf53b2753ece3d9d3ea6a2e6577604abed5
4
+ data.tar.gz: 12ed04d605742208a15ec7d9496a65e1c74cd61a
5
+ SHA512:
6
+ metadata.gz: 85ef4b83fd592205813160e5472e1244d8dcf78311001c29791e9e8bfe431130e1e914191c6a87c5f18305fc9c5dab1740033e3e6544b55cd5b63fd76b89d37a
7
+ data.tar.gz: 3c005b0c8ffa36f76f77093a17ecc1696e8ab587fb20623112da00aa839750f4c02e120371c0375639102982a4be6c8d6b3fa22b2387261aa41192749f64b70f
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+ .idea
16
+ .ruby-version
17
+ *.war
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in contracto.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Kacper Walanus
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,31 @@
1
+ # Contracto
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'contracto'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install contracto
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/contracto/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/contracto ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ lib = File.expand_path(File.dirname(__FILE__) + '/../lib')
4
+ $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
5
+
6
+ require 'contracto'
7
+ require 'contracto/command'
8
+
9
+ args = ARGV.dup
10
+ ARGV.clear
11
+ command = args.shift.strip rescue 'help'
12
+
13
+ Contracto::Command.run(command, args)
data/contracto.gemspec ADDED
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'contracto/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'contracto'
8
+ spec.version = Contracto::VERSION
9
+ spec.authors = ['Kacper Walanus']
10
+ spec.email = ['kacper@walanus.com']
11
+ spec.summary = %q{XXX}
12
+ spec.description = %q{XXX}
13
+ spec.homepage = ''
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
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_runtime_dependency 'sinatra', '~> 1.4'
22
+
23
+ spec.add_development_dependency 'bundler', '~> 1.7'
24
+ spec.add_development_dependency 'rake', '~> 10.0'
25
+ end
@@ -0,0 +1,26 @@
1
+ require 'fileutils'
2
+
3
+ class Contracto::Command
4
+ class << self
5
+
6
+ def run(command, args)
7
+ case command
8
+ when 'install'
9
+ FileUtils.rm_rf 'contracto'
10
+ FileUtils.cp_r "#{gem_dir}/lib/contracto/server/ruby", 'contracto_'
11
+ FileUtils.mv 'contracto_', 'contracto'
12
+ unless File.exist? 'contract.cdc.rb'
13
+ FileUtils.mv 'contracto/contract.cdc.rb', '.'
14
+ puts 'created: contract.cdc.rb'
15
+ end
16
+
17
+ when 'run'
18
+ system 'rackup contracto/config.ru'
19
+ end
20
+ end
21
+
22
+ def gem_dir
23
+ @gem_dir ||= Gem::Specification.find_by_name('contracto').gem_dir
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,5 @@
1
+ require_relative 'server'
2
+
3
+ set :run, false
4
+ set :environment, :production
5
+ run Sinatra::Application
@@ -0,0 +1,5 @@
1
+ # TODO: Should require all *.cdc.rb files
2
+
3
+ get '/sample' do
4
+ 'sample GET'
5
+ end
@@ -0,0 +1,7 @@
1
+ require_relative 'sinatra-1.4.5/lib/sinatra'
2
+
3
+ require_relative '../contract.cdc'
4
+
5
+ get '/' do
6
+ 'Server is working!'
7
+ end