ganexa 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3fb56da2d8961cf089a36a6bac00874e7b3374f3
4
+ data.tar.gz: af82aa5753c6cdbde0d79e8fb91b13cd9132fa9d
5
+ SHA512:
6
+ metadata.gz: afb460f2b9427b2516b9f068841565a9cf6c199f54f5ca7c66eb29a5aac9f039d7d0a10887c4ee79f78855b76255e0e2447a3da619af4d980d58a3de8f472299
7
+ data.tar.gz: b72dfb86d4aecb719a8e932363f830b867dd51fef7dfdd8091a18783cd7c39c3a8adffee75163661a45532b8679c5de5f66620d76d37ac9c826d90d3429753d5
@@ -0,0 +1,9 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = space
5
+ indent_size = 2
6
+ end_of_line = lf
7
+ charset = utf-8
8
+ trim_trailing_whitespace = true
9
+ insert_final_newline = true
@@ -0,0 +1 @@
1
+ *.gem
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
@@ -0,0 +1,45 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ ganexa (0.1.0)
5
+ sinatra
6
+ thor (~> 0.19)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ diff-lcs (1.3)
12
+ mustermann (1.0.0)
13
+ rack (2.0.3)
14
+ rack-protection (2.0.0)
15
+ rack
16
+ rspec (3.6.0)
17
+ rspec-core (~> 3.6.0)
18
+ rspec-expectations (~> 3.6.0)
19
+ rspec-mocks (~> 3.6.0)
20
+ rspec-core (3.6.0)
21
+ rspec-support (~> 3.6.0)
22
+ rspec-expectations (3.6.0)
23
+ diff-lcs (>= 1.2.0, < 2.0)
24
+ rspec-support (~> 3.6.0)
25
+ rspec-mocks (3.6.0)
26
+ diff-lcs (>= 1.2.0, < 2.0)
27
+ rspec-support (~> 3.6.0)
28
+ rspec-support (3.6.0)
29
+ sinatra (2.0.0)
30
+ mustermann (~> 1.0)
31
+ rack (~> 2.0)
32
+ rack-protection (= 2.0.0)
33
+ tilt (~> 2.0)
34
+ thor (0.20.0)
35
+ tilt (2.0.8)
36
+
37
+ PLATFORMS
38
+ ruby
39
+
40
+ DEPENDENCIES
41
+ ganexa!
42
+ rspec (~> 3)
43
+
44
+ BUNDLED WITH
45
+ 1.15.3
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Dayvson Lima
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,22 @@
1
+ ganexa
2
+ =================
3
+
4
+
5
+
6
+ ## Setup
7
+
8
+ 1. Install `gem install ganexa`.
9
+
10
+ ## Usage
11
+
12
+ _Fill in with gem usage information._
13
+
14
+ ## Development
15
+
16
+ When hacking on this gem, the REPL `pry` comes in handy. You can load the
17
+ contents of the gem with `pry --gem`.
18
+
19
+ To test the CLI, run
20
+
21
+ ruby -Ilib bin/ganexa
22
+
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require "ganexa/cli"
3
+
4
+ Ganexa::CLI.start
@@ -0,0 +1,25 @@
1
+ # encoding: utf-8
2
+ require File.expand_path("../lib/ganexa/version", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "ganexa"
6
+ s.version = Ganexa::VERSION
7
+ s.authors = ["Dayvson Lima"]
8
+ s.email = ["dayvsonlima31@gmail.com"]
9
+ s.homepage = "https://github.com/dayvsonlima/ganexa"
10
+ s.summary = "Programing ruby like PHP"
11
+ s.description = "Ganexa framework provides the experience of " \
12
+ "programming in php scripts, with the advantage "\
13
+ "of programming in the ruby language"
14
+
15
+ s.licenses = ['MIT']
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ['lib']
20
+
21
+ s.add_runtime_dependency 'thor', '~> 0.19'
22
+ s.add_runtime_dependency 'sinatra', '~> 0'
23
+
24
+ s.add_development_dependency 'rspec', '~> 3'
25
+ end
@@ -0,0 +1,4 @@
1
+ module Ganexa
2
+ require 'ganexa/version'
3
+ # This is your gem's load point. Require your components here.
4
+ end
@@ -0,0 +1,23 @@
1
+ require 'thor'
2
+ require 'ganexa'
3
+ require_relative '../server/app'
4
+
5
+ trap("SIGINT") { exit! }
6
+
7
+ module Ganexa
8
+ class CLI < Thor
9
+ include Thor::Actions
10
+
11
+ map %w(-v --version) => :version
12
+
13
+ desc 'server', 'ganexa server'
14
+ def server
15
+ App.run!
16
+ end
17
+
18
+ desc 'version', 'ganexa version'
19
+ def version
20
+ puts Ganexa::VERSION
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,3 @@
1
+ module Ganexa
2
+ VERSION = '0.1.0'
3
+ end
@@ -0,0 +1,33 @@
1
+ require 'sinatra/base'
2
+
3
+ class App < Sinatra::Base
4
+ %i(get post).each do |method|
5
+ send method, '/*' do
6
+
7
+ get_params = request.query_string.split('&')
8
+
9
+ $_GET = get_params.map{|param| param.split('=') }
10
+ .map{|param| [param[0], param[1] ] }
11
+
12
+ $_GET ||= []
13
+
14
+ $_GET = $_GET.to_h
15
+
16
+ if request.request_method == 'POST'
17
+ $_POST = params
18
+ end
19
+
20
+ template_path = "#{Dir.pwd}#{request.path_info}"
21
+
22
+ begin
23
+ file = File.open(template_path)
24
+ rescue
25
+ return 'file not found'
26
+ end
27
+
28
+ content = file.read
29
+ template = ERB.new(content)
30
+ template.result
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,2 @@
1
+ require 'rspec'
2
+ require 'ganexa'
metadata ADDED
@@ -0,0 +1,101 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ganexa
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Dayvson Lima
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-08-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.19'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.19'
27
+ - !ruby/object:Gem::Dependency
28
+ name: sinatra
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3'
55
+ description: Ganexa framework provides the experience of programming in php scripts,
56
+ with the advantage of programming in the ruby language
57
+ email:
58
+ - dayvsonlima31@gmail.com
59
+ executables:
60
+ - ganexa
61
+ extensions: []
62
+ extra_rdoc_files: []
63
+ files:
64
+ - ".editorconfig"
65
+ - ".gitignore"
66
+ - Gemfile
67
+ - Gemfile.lock
68
+ - LICENSE
69
+ - README.md
70
+ - bin/ganexa
71
+ - ganexa.gemspec
72
+ - lib/ganexa.rb
73
+ - lib/ganexa/cli.rb
74
+ - lib/ganexa/version.rb
75
+ - lib/server/app.rb
76
+ - spec/spec_helper.rb
77
+ homepage: https://github.com/dayvsonlima/ganexa
78
+ licenses:
79
+ - MIT
80
+ metadata: {}
81
+ post_install_message:
82
+ rdoc_options: []
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ requirements: []
96
+ rubyforge_project:
97
+ rubygems_version: 2.6.11
98
+ signing_key:
99
+ specification_version: 4
100
+ summary: Programing ruby like PHP
101
+ test_files: []