actn-api 0.0.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 807e280786d02db2159f98d45e26f1003261d70b
4
- data.tar.gz: 9b4cf9eae9b9013c4fbe6c67cefe8c05d052dfea
3
+ metadata.gz: be30fe02140894b1c51f7cf42f813ee76a7cf112
4
+ data.tar.gz: 3e6b1a78dffc0a123c7a288c5c52b509e719c818
5
5
  SHA512:
6
- metadata.gz: 59e325499327105f37db20082cba9c8f188c24319693c57c457a5f799bffceceb94da8a01b11b900b3d15b53d418f421ce94c8e1932701eee89f1e3670966398
7
- data.tar.gz: 6c4c0f4184b3e6f0a6cdc119357128ce01d3b54979bc8167ce486972be09432ff11fd70b77c3e2c3045bd56ec31ea18c83044100f7f35866fc6a1ade8a14081b
6
+ metadata.gz: b4dea90b91ac648b97749d722816e85531aa98639d0e81eb0e87148e6b5ef219b2071e578b7d0fde259d9e93afa7981b01f5860c151f1de6df25547b2285ae39
7
+ data.tar.gz: d7543b97c91ac3ef7548ad3e5c982057ccd425721daf505587b063fc2fc6b74f5df2895063ea84016548dd6bcd1758f667ad13792da562c080d86f8237ca63f4
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ .env
data/Procfile CHANGED
@@ -1,10 +1,10 @@
1
- web-pub-connect: bundle exec actn-api public/connect -p 6000 -sv -c config/public.rb
2
- web-pub-query: bundle exec actn-api public/query -p 6001 -sv -c config/public.rb
3
- web-pub-upsert: bundle exec actn-api public/upsert -p 6002 -sv -c config/public.rb
4
- web-pub-delete: bundle exec actn-api public/delete -p 6003 -sv -c config/public.rb
1
+ web-pub-connect: bundle exec actn-api public/connect -p 6000 -sv
2
+ web-pub-query: bundle exec actn-api public/query -p 6001 -sv
3
+ web-pub-upsert: bundle exec actn-api public/upsert -p 6002 -sv
4
+ web-pub-delete: bundle exec actn-api public/delete -p 6003 -sv
5
5
 
6
- web-core-back: bundle exec actn-api core/backend -p 7000 -sv -c config/core.rb
7
- web-core-front: bundle exec actn-api core/frontend -p 7001 -sv -c config/core.rb
6
+ web-core-back: bundle exec actn-api core/backend -p 7000 -sv
7
+ web-core-front: bundle exec actn-api core/frontend -p 7001 -sv
8
8
 
9
9
  worker-jobs: bundle exec rake jobs:work
10
10
 
data/actn-api.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
15
15
  spec.files = `git ls-files`.split($/)
16
16
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
- spec.require_paths = ["apis","lib","views","config"]
18
+ spec.require_paths = ["lib"]
19
19
 
20
20
  spec.add_development_dependency "bundler", "~> 1.5"
21
21
  spec.add_development_dependency "rake"
data/bin/actn-api CHANGED
@@ -1,36 +1,45 @@
1
1
  #!/usr/bin/env ruby
2
+ # $LOAD_PATH.unshift File.expand_path(Actn::Api.gem_root)
3
+
4
+ $stdout.sync = true
5
+ $stderr.sync = true
6
+
7
+ ENV['DATABASE_URL'] ||= "postgres://localhost:5432/actn_#{ENV['RACK_ENV'] ||= "development"}"
2
8
 
3
9
  abort unless api_name = ARGV.shift
10
+
4
11
  if api_name == "console"
12
+ require "actn/api"
13
+ require "actn/db"
14
+ require "actn/jobs"
5
15
  api_name = "public/query"
16
+ ARGV << "-c"
17
+ ARGV << "#{Actn::Api.gem_root}/config/common.rb"
6
18
  ARGV << "-C"
7
- require "actn/db"
8
- require "actn/jobs"
19
+ else
20
+ require "actn/api"
21
+ ARGV << "-c"
22
+ ARGV << "#{Actn::Api.gem_root}/config/#{api_name.split("/").first}.rb"
9
23
  end
10
24
 
11
- $stdout.sync = true
12
- $stderr.sync = true
13
-
14
- $LOAD_PATH.unshift File.expand_path('../', __FILE__)
15
- $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
16
25
 
17
- ENV['DATABASE_URL'] ||= "postgres://localhost:5432/actn_#{ENV['RACK_ENV'] ||= "development"}"
18
26
 
19
27
  require 'i18n'
20
- require "actn/api"
21
28
  require "active_support/inflector"
29
+
22
30
  require "goliath/api"
23
31
  require "goliath/runner"
24
- require "#{api_name}"
25
32
 
26
- unless api_name == "console"
27
- ARGV[ARGV.length-1] = "#{Actn::Api.gem_root}/#{ARGV[ARGV.length-1]}"
28
- end
33
+ require "#{Actn::Api.gem_root}/apis/#{api_name}"
29
34
 
30
35
  I18n.enforce_available_locales = false
31
36
 
32
37
  api_class = api_name.classify.demodulize.constantize
38
+
33
39
  runner = Goliath::Runner.new(ARGV, nil)
40
+
41
+ # puts runner.inspect
42
+
34
43
  runner.api = api_class.new
35
44
  runner.app = Goliath::Rack::Builder.build(api_class, runner.api)
36
45
  runner.run
@@ -1,4 +1,4 @@
1
- require 'goliath'
1
+ require 'goliath/api'
2
2
  require 'actn/db/set'
3
3
  require 'actn/api/client'
4
4
  require 'actn/api/mw/auth'
@@ -1,5 +1,5 @@
1
1
  module Actn
2
2
  module Api
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actn-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Onur Uyar
@@ -225,10 +225,7 @@ metadata: {}
225
225
  post_install_message:
226
226
  rdoc_options: []
227
227
  require_paths:
228
- - apis
229
228
  - lib
230
- - views
231
- - config
232
229
  required_ruby_version: !ruby/object:Gem::Requirement
233
230
  requirements:
234
231
  - - '>='