Skip to content
This repository has been archived by the owner on Nov 25, 2018. It is now read-only.

Commit

Permalink
Switch to Lattice::Resources
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri committed Aug 30, 2013
1 parent 1c0fef8 commit 3239d4e
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 167 deletions.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -5,6 +5,7 @@ gem 'rbnacl', github: 'cryptosphere/rbnacl'

gem 'celluloid', github: 'celluloid/celluloid'
gem 'celluloid-io', github: 'celluloid/celluloid-io'
gem 'lattice', github: 'celluloid/lattice'
gem 'reel', github: 'celluloid/reel'
gem 'http', github: 'tarcieri/http'

Expand Down
4 changes: 1 addition & 3 deletions cryptosphere.gemspec
Expand Up @@ -16,12 +16,10 @@ Gem::Specification.new do |gem|
gem.version = Cryptosphere::VERSION

gem.add_runtime_dependency "celluloid"
gem.add_runtime_dependency "reel"
gem.add_runtime_dependency "webmachine"
gem.add_runtime_dependency "lattice"
gem.add_runtime_dependency "thor"
gem.add_runtime_dependency "rbnacl"
gem.add_runtime_dependency "base32"
gem.add_runtime_dependency "activesupport", "~> 4.0.0"

gem.add_development_dependency "rake"
gem.add_development_dependency "rspec"
Expand Down
3 changes: 3 additions & 0 deletions lib/cryptosphere.rb
@@ -1,5 +1,8 @@
require 'cryptosphere/version'

require 'celluloid'
require 'lattice'

require 'cryptosphere/block'
require 'cryptosphere/encoding'
require 'cryptosphere/pkt_line_reader'
Expand Down
1 change: 0 additions & 1 deletion lib/cryptosphere/app.rb
@@ -1,5 +1,4 @@
require 'cryptosphere'
require 'cryptosphere/resource'

require 'cryptosphere/git'
require 'cryptosphere/resources/asset'
Expand Down
5 changes: 2 additions & 3 deletions lib/cryptosphere/git/receive_pack.rb
@@ -1,9 +1,8 @@
require 'cryptosphere/resource'
require 'cryptosphere/pkt_line_reader'

module Cryptosphere
module Git
class ReceivePack < Resource
class ReceivePack < Lattice::Resource
allow :get, :head, :post, :options

accept_content_type 'application/x-git-receive-pack-request' => :accept_pack
Expand Down Expand Up @@ -36,4 +35,4 @@ def accept_pack
end
end
end
end
end
6 changes: 2 additions & 4 deletions lib/cryptosphere/git/refs.rb
@@ -1,8 +1,6 @@
require 'cryptosphere/resource'

module Cryptosphere
module Git
class Refs < Resource
class Refs < Lattice::Resource
# Pack data header for the HTTP-based git-receive-pack service
# TODO: roll this up with some other related code somewhere
SERVICE_HEADER = "001f# service=git-receive-pack"
Expand Down Expand Up @@ -45,4 +43,4 @@ def to_advertisement
end
end
end
end
end
70 changes: 0 additions & 70 deletions lib/cryptosphere/resource.rb

This file was deleted.

6 changes: 2 additions & 4 deletions lib/cryptosphere/resources/asset.rb
@@ -1,8 +1,6 @@
require 'cryptosphere/resource'

module Cryptosphere
module Resources
class Asset < Resource
class Asset < Lattice::Resource
ASSET_ROOT = File.expand_path("../../assets", __FILE__)
FILE_LIST = Dir[File.join(ASSET_ROOT, "**", "*")].map { |f| f.sub(/^#{ASSET_ROOT}\//, '') }

Expand Down Expand Up @@ -37,4 +35,4 @@ def asset_path
end
end
end
end
end
6 changes: 2 additions & 4 deletions lib/cryptosphere/resources/home.rb
@@ -1,12 +1,10 @@
require 'cryptosphere/resource'

module Cryptosphere
module Resources
class Home < Resource
class Home < Lattice::Resource
def to_html
# Hax serve a static file!
File.read File.expand_path("../../assets/index.html", __FILE__)
end
end
end
end
end
78 changes: 0 additions & 78 deletions spec/cryptosphere/resource_spec.rb

This file was deleted.

0 comments on commit 3239d4e

Please sign in to comment.