alephant 0.0.2-java → 0.0.3-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/README.md +3 -1
- data/Rakefile +9 -0
- data/alephant.gemspec +15 -3
- data/lib/alephant.rb +5 -5
- data/lib/{models → alephant/models}/cache.rb +0 -0
- data/lib/{models → alephant/models}/renderer.rb +0 -0
- data/lib/{models → alephant/models}/sequencer.rb +0 -0
- data/lib/alephant/version.rb +3 -0
- data/package.py +71 -0
- data/project.json +11 -0
- data/spec/foo_spec.rb +5 -0
- metadata +53 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fdb4ac2f34ec66ad78e4a5f312ca2bf9c95e755
|
4
|
+
data.tar.gz: 47b7a310bfe3d304625fe53e2a9484be33ffdcab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78bfe8034f1139f7f3eb71ced0fb5b15e1a0b27feb020100fd026c1059a60e7ab0bb5eab9f704e18ce9ce88e604e7aa29a34e2d24e74c7347d7e9a1182d27d21
|
7
|
+
data.tar.gz: 8dbc4c0f41e345a69c28a651bae4515537492699ba532d66223c4a8bb8d758f3ad8ead14696167c6a099e6ca93a4a661dfb8123ccb823590eae1dc1dffbab393
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -3,7 +3,9 @@ alephant
|
|
3
3
|
|
4
4
|
[![Code Climate](https://codeclimate.com/repos/52cd866de30ba018f10000a2/badges/5d9c02131201565a630e/gpa.png)](https://codeclimate.com/repos/52cd866de30ba018f10000a2/feed)
|
5
5
|
|
6
|
-
|
6
|
+
[![Build Status](https://travis-ci.org/kenoir/alephant.png?branch=master)](https://travis-ci.org/kenoir/alephant)
|
7
|
+
|
8
|
+
Static publishing to S3 on push notification from SQS
|
7
9
|
|
8
10
|
##Dependencies
|
9
11
|
|
data/Rakefile
ADDED
data/alephant.gemspec
CHANGED
@@ -1,18 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
require 'alephant/version'
|
6
|
+
|
1
7
|
Gem::Specification.new do |s|
|
2
8
|
s.name = 'alephant'
|
3
|
-
s.version =
|
9
|
+
s.version = Alephant::VERSION
|
4
10
|
s.date = '2014-01-08'
|
5
11
|
s.summary = "Static Publishing in the Cloud"
|
6
12
|
s.description = "Static publishing to S3 based on SQS messages"
|
7
13
|
s.authors = ["Robert Kenny"]
|
8
14
|
s.email = 'kenoir@gmail.com'
|
9
|
-
s.
|
15
|
+
s.license = 'GPLv3'
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split($/)
|
10
18
|
s.platform = "java"
|
11
19
|
s.homepage =
|
12
20
|
'http://rubygems.org/gems/alephant'
|
13
|
-
s.
|
21
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
14
22
|
s.require_paths = ["lib"]
|
15
23
|
|
24
|
+
s.add_development_dependency "rake"
|
25
|
+
s.add_development_dependency "rspec"
|
26
|
+
s.add_development_dependency "pry"
|
27
|
+
|
16
28
|
s.add_runtime_dependency 'aws-sdk', '~> 1.0'
|
17
29
|
s.add_runtime_dependency 'mustache', '>= 0.99.5'
|
18
30
|
end
|
data/lib/alephant.rb
CHANGED
@@ -2,9 +2,9 @@ require 'aws-sdk'
|
|
2
2
|
require 'env'
|
3
3
|
require 'json'
|
4
4
|
|
5
|
-
require 'models/cache'
|
6
|
-
require 'models/renderer'
|
7
|
-
require 'models/sequencer'
|
5
|
+
require 'alephant/models/cache'
|
6
|
+
require 'alephant/models/renderer'
|
7
|
+
require 'alephant/models/sequencer'
|
8
8
|
|
9
9
|
module Alephant
|
10
10
|
|
@@ -14,7 +14,7 @@ module Alephant
|
|
14
14
|
sequencer = Sequencer.new(cache_id)
|
15
15
|
renderer = Renderer.new(cache_id)
|
16
16
|
|
17
|
-
|
17
|
+
thread = Thread.new do
|
18
18
|
puts "Polling queue..."
|
19
19
|
queue.poll do |msg|
|
20
20
|
data = JSON.parse(msg.body)
|
@@ -29,7 +29,7 @@ module Alephant
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
|
32
|
+
thread
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
File without changes
|
File without changes
|
File without changes
|
data/package.py
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
from subprocess import check_call as call
|
2
|
+
import tempfile
|
3
|
+
|
4
|
+
def package(builder):
|
5
|
+
|
6
|
+
name = builder.name
|
7
|
+
jruby_version = builder.metadata["packaging"]["jruby_version"]
|
8
|
+
install_path = "/usr/lib/{0}".format(builder.name)
|
9
|
+
|
10
|
+
tmpdir = tempfile.mkdtemp()
|
11
|
+
|
12
|
+
def install_jruby():
|
13
|
+
|
14
|
+
url = "http://jruby.org.s3.amazonaws.com/downloads/{0}/jruby-bin-{0}.tar.gz".format(jruby_version)
|
15
|
+
package_path = "{0}/jruby-bin-{1}.tar.gz".format(tmpdir, jruby_version)
|
16
|
+
|
17
|
+
print "Downloading JRuby {0}".format(jruby_version)
|
18
|
+
call(["/usr/bin/curl", "--progress-bar", "-L", url, "-o", package_path])
|
19
|
+
|
20
|
+
print "Extracting {0}".format(package_path)
|
21
|
+
call(["tar", "zxf", package_path, "-C", tmpdir])
|
22
|
+
|
23
|
+
def create_jar():
|
24
|
+
gem_bin = "{0}/jruby-{1}/bin/gem".format(tmpdir, jruby_version)
|
25
|
+
jruby_bin = "{0}/jruby-{1}/bin/jruby".format(tmpdir, jruby_version)
|
26
|
+
# gem_home = "{0}/jruby-{1}/lib/ruby/gems/shared".format(tmpdir, jruby_version)
|
27
|
+
|
28
|
+
# print "Installing bundler: {0}".format(gem_bin)
|
29
|
+
call([jruby_bin, gem_bin, "install", "bundler", "--install-dir", ".gem"])
|
30
|
+
call([jruby_bin, "-e", "ENV['GEM_HOME']=File.join(Dir.pwd,'.gem');ENV['GEM_PATH']=File.join(Dir.pwd,'.gem');ENV['BUNDLE_GEMFILE']=File.join(Dir.pwd,'Gemfile');require'rubygems';require'bundler';require'bundler/cli';cli=Bundler::CLI.start"])
|
31
|
+
call([jruby_bin, "-e", "ENV['GEM_HOME']=File.join(Dir.pwd,'.gem');ENV['GEM_PATH']=File.join(Dir.pwd,'.gem');ENV['BUNDLE_GEMFILE']=File.join(Dir.pwd,'Gemfile');require'rubygems';require'warbler';Dir.mkdir('target');Warbler::Application.new.run;"])
|
32
|
+
|
33
|
+
|
34
|
+
def setup_dependencies():
|
35
|
+
builder.spec.set_build_arch('x86_64')
|
36
|
+
|
37
|
+
builder.spec.add_build_requires([
|
38
|
+
'cosmos-ca-tools'
|
39
|
+
])
|
40
|
+
|
41
|
+
def user():
|
42
|
+
builder.spec.add_pre_steps([
|
43
|
+
["groupadd -r {0}".format(name)],
|
44
|
+
["useradd -r -g {0} -G {0} -d / -s /sbin/nologin -c \"{0} ruby service\" {0}".format(name)]
|
45
|
+
])
|
46
|
+
|
47
|
+
def set_perms():
|
48
|
+
builder.spec.add_pre_steps([
|
49
|
+
["chown -R {0}:{0}".format(name)],
|
50
|
+
["chmod 744 {0}".format(install_path)]
|
51
|
+
])
|
52
|
+
|
53
|
+
def setup_bundler():
|
54
|
+
builder.spec.add_post_steps([
|
55
|
+
['/opt/jruby/bin/gem install bundler --no-ri --no-rdoc']
|
56
|
+
])
|
57
|
+
|
58
|
+
def install_gems():
|
59
|
+
builder.spec.add_post_steps([[
|
60
|
+
"GEM_HOME=/opt/jruby/lib/ruby/gems/shared",
|
61
|
+
"BUNDLE_GEMFILE={0}/Gemfile".format(install_path),
|
62
|
+
"/opt/jruby/bin/jruby -e \"require 'bundler/cli'; Bundler::CLI.start\""]
|
63
|
+
])
|
64
|
+
|
65
|
+
install_jruby()
|
66
|
+
create_jar()
|
67
|
+
|
68
|
+
setup_dependencies()
|
69
|
+
user()
|
70
|
+
setup_bundler()
|
71
|
+
install_gems()
|
data/project.json
ADDED
data/spec/foo_spec.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alephant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Robert Kenny
|
@@ -10,6 +10,48 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2014-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
version_requirements: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
requirement: !ruby/object:Gem::Requirement
|
21
|
+
requirements:
|
22
|
+
- - '>='
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: '0'
|
25
|
+
prerelease: false
|
26
|
+
type: :development
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - '>='
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
prerelease: false
|
40
|
+
type: :development
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry
|
43
|
+
version_requirements: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - '>='
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
prerelease: false
|
54
|
+
type: :development
|
13
55
|
- !ruby/object:Gem::Dependency
|
14
56
|
name: aws-sdk
|
15
57
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -50,12 +92,17 @@ files:
|
|
50
92
|
- Gemfile
|
51
93
|
- LICENSE
|
52
94
|
- README.md
|
95
|
+
- Rakefile
|
53
96
|
- alephant.gemspec
|
54
97
|
- lib/alephant.rb
|
98
|
+
- lib/alephant/models/cache.rb
|
99
|
+
- lib/alephant/models/renderer.rb
|
100
|
+
- lib/alephant/models/sequencer.rb
|
101
|
+
- lib/alephant/version.rb
|
55
102
|
- lib/env.rb
|
56
|
-
-
|
57
|
-
-
|
58
|
-
-
|
103
|
+
- package.py
|
104
|
+
- project.json
|
105
|
+
- spec/foo_spec.rb
|
59
106
|
homepage: http://rubygems.org/gems/alephant
|
60
107
|
licenses:
|
61
108
|
- GPLv3
|
@@ -80,4 +127,5 @@ rubygems_version: 2.1.9
|
|
80
127
|
signing_key:
|
81
128
|
specification_version: 4
|
82
129
|
summary: Static Publishing in the Cloud
|
83
|
-
test_files:
|
130
|
+
test_files:
|
131
|
+
- spec/foo_spec.rb
|