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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 37a70792f0081e3259de28b88bfca916b02f95ae
4
- data.tar.gz: 4e037551f11a7bc3be26c4ba01e136a09e56d7d8
3
+ metadata.gz: 5fdb4ac2f34ec66ad78e4a5f312ca2bf9c95e755
4
+ data.tar.gz: 47b7a310bfe3d304625fe53e2a9484be33ffdcab
5
5
  SHA512:
6
- metadata.gz: 54f985e1e708c0a8ca744f19c23c5999aae2be84ef4f289f8364f1e71b7b75b3ec47e3bf1fc1d780b2e9886717827c2873015f8495a3fef6fa41e4336f511fcf
7
- data.tar.gz: 5794fab1d26a96293e43553e217579d289c29cf09aa764e57bf1006d5046a51ae18db47dde895215c100cb16512b8af9f72af644573ef1fc55e909716e7e0855
6
+ metadata.gz: 78bfe8034f1139f7f3eb71ced0fb5b15e1a0b27feb020100fd026c1059a60e7ab0bb5eab9f704e18ce9ce88e604e7aa29a34e2d24e74c7347d7e9a1182d27d21
7
+ data.tar.gz: 8dbc4c0f41e345a69c28a651bae4515537492699ba532d66223c4a8bb8d758f3ad8ead14696167c6a099e6ca93a4a661dfb8123ccb823590eae1dc1dffbab393
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  config/*.yml
2
- *.gem
2
+ Gemfile.lock
3
+ pkg/*.gem
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
- Static publishing to s3 on push notification from SQS
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
 
@@ -0,0 +1,9 @@
1
+ $:.unshift File.join(File.dirname(__FILE__), 'lib')
2
+
3
+ require 'rspec/core/rake_task'
4
+ require "bundler/gem_tasks"
5
+ require 'alephant'
6
+
7
+ RSpec::Core::RakeTask.new(:spec)
8
+
9
+ task :default => :spec
@@ -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 = '0.0.2'
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.files = `git ls-files`.split("\n")
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.license = 'GPLv3'
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
@@ -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
- t = Thread.new do
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
- t.join
32
+ thread
33
33
  end
34
34
  end
35
35
 
File without changes
@@ -0,0 +1,3 @@
1
+ module Alephant
2
+ VERSION = "0.0.3"
3
+ end
@@ -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()
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "S3-Render",
3
+ "packaging": {
4
+ "type": "custom_service",
5
+ "application_port": 7080,
6
+ "jruby_version": "1.7.9",
7
+ "requires": [
8
+ "jruby"
9
+ ]
10
+ }
11
+ }
@@ -0,0 +1,5 @@
1
+ describe "a test that fails" do
2
+ it "fails so hard" do
3
+ fail
4
+ end
5
+ end
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.2
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
- - lib/models/cache.rb
57
- - lib/models/renderer.rb
58
- - lib/models/sequencer.rb
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