ts-admin 0.2.0

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.
Binary file
Binary file
data/spec/helper.rb ADDED
@@ -0,0 +1,39 @@
1
+ require File.expand_path('../../app', __FILE__)
2
+
3
+ # This file can be used to set various configuration options for your testing
4
+ # suite. Ramaze itself uses Bacon but you're not forced to use this. Want to
5
+ # use Rspec instead? Go ahead!
6
+ #
7
+ # If you do happen to use Bacon you can uncomment the following lines to get
8
+ # started with testing Ramaze using Bacon:
9
+ #
10
+ # require 'bacon'
11
+ # require 'ramaze/spec/bacon'
12
+
13
+ # The following code is an example on how to set up Capybara
14
+ # (https://github.com/jnicklas/capybara) for Ramaze. If you don't use Capybara
15
+ # you can safely remove these comments.
16
+ #
17
+ # require 'capybara/dsl'
18
+ #
19
+ # Capybara.configure do |config|
20
+ # config.default_driver = :rack_test
21
+ # config.app = Ramaze
22
+ # end
23
+ #
24
+ # shared :capybara do
25
+ # Ramaze.setup_dependencies
26
+ #
27
+ # extend Capybara::DSL
28
+ # end
29
+ #
30
+
31
+ # The following few lines of code are the most basic settings you'll want to
32
+ # use for testing Ramaze. They ensure that the environment is set correctly and
33
+ # that your output isn't clogged with non important information.
34
+ Ramaze.middleware :spec do
35
+ run Ramaze.core
36
+ end
37
+
38
+ Ramaze::Log.level = Logger::ERROR
39
+ Ramaze.options.mode = :spec
data/task/ramaze.rake ADDED
@@ -0,0 +1,57 @@
1
+ # This file contains a predefined set of Rake tasks that can be useful when
2
+ # developing Ramaze applications. You're free to modify these tasks to your
3
+ # liking, they will not be overwritten when updating Ramaze.
4
+
5
+ namespace :ramaze do
6
+ app = File.expand_path('../../app', __FILE__)
7
+
8
+ desc 'Starts a Ramaze console using IRB'
9
+ task :irb do
10
+ require app
11
+ require 'irb'
12
+ require 'irb/completion'
13
+
14
+ ARGV.clear
15
+ IRB.start
16
+ end
17
+
18
+ # Pry can be installed using `gem install pry`.
19
+ desc 'Starts a Ramaze console using Pry'
20
+ task :pry do
21
+ require app
22
+ require 'pry'
23
+
24
+ ARGV.clear
25
+ Pry.start
26
+ end
27
+
28
+ # In case you want to use a different server or port you can freely modify
29
+ # the options passed to `Ramaze.start()`.
30
+ desc 'Starts Ramaze for development'
31
+ task :start do
32
+ require app
33
+
34
+ Ramaze.start(
35
+ :adapter => :webrick,
36
+ :port => 7000,
37
+ :file => __FILE__,
38
+ :root => Ramaze.options.roots
39
+ )
40
+ end
41
+
42
+ desc 'Lists all the routes defined using Ramaze::Route'
43
+ task :routes do
44
+ require app
45
+
46
+ if Ramaze::Route::ROUTES.empty?
47
+ abort 'No routes have been defined using Ramaze::Route'
48
+ end
49
+
50
+ spacing = Ramaze::Route::ROUTES.map { |k, v| k.to_s }
51
+ spacing = spacing.sort { |l, r| r.length <=> l.length }[0].length
52
+
53
+ Ramaze::Route::ROUTES.each do |from, to|
54
+ puts "%-#{spacing}s => %s" % [from, to]
55
+ end
56
+ end
57
+ end
data/ts-admin.gemspec ADDED
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'ts-admin/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ts-admin"
8
+ spec.version = TSAdmin::VERSION
9
+ spec.authors = ["Florian Schwab"]
10
+ spec.email = ["florian.schwab@sic-software.com"]
11
+ spec.description = %q{Frontend for managing ATS remap configuration}
12
+ spec.summary = %q{Frontend for managing ATS remap configuration}
13
+ spec.homepage = "http://www.sic-software.com/"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+
24
+ spec.add_dependency "ramaze", ">= 2.0.0"
25
+ end
data/view/index.xhtml ADDED
@@ -0,0 +1,3 @@
1
+ <div class="grid_12 content">
2
+ <p>The Apache Traffic Server is reachable with the external IP address #{@external_ip}</p>
3
+ </div>
@@ -0,0 +1,18 @@
1
+ <div class="grid_12 content">
2
+ <header>
3
+ <h2>Remap entry</h2>
4
+ </header>
5
+ <form method="post" action="/remap/#{defined?(@id) ? 'edit' : 'new'}">
6
+ <p>
7
+ <label for="from">From</label>
8
+ <input type="text" name="from" value="#{@from if defined?(@from)}" style="width: 400px;" />
9
+ </p>
10
+ <p>
11
+ <label for="to">To</label>
12
+ <input type="text" name="to" value="#{@to if defined?(@to)}" style="width: 400px;" />
13
+ </p>
14
+ <input type="submit" value="Save" />
15
+ <input type="hidden" name="type" value="#{@type}" />
16
+ <input type="hidden" name="id" value="#{@id if defined?(@id)}" />
17
+ </form>
18
+ </div>
@@ -0,0 +1,2 @@
1
+ #{render_partial :list, :type => :map, :headline => 'Mappings'}
2
+ #{render_partial :list, :type => :redirect, :headline => 'Redirects'}
@@ -0,0 +1,23 @@
1
+ <div class="grid_12 content">
2
+ <header>
3
+ <div class="buttons">
4
+ <a class="icon-plus" href="/remap/new?type=#{@type}" title="Add new rule"></a>
5
+ </div>
6
+ <h2>#{@headline}</h2>
7
+ </header>
8
+ <p>
9
+ <ul class="remap">
10
+ <?r @traffic_server.send("#{@type}s").each_with_index do |map, i| ?>
11
+ <li>
12
+ <span class="url from"><a href="#{map[:from]}">#{remap_url_highlight_scheme(map[:from])}</a></span>
13
+ <span class="arrow icon-chevron-right"></span>
14
+ <span class="url to"><a href="#{map[:to]}">#{remap_url_highlight_scheme(map[:to])}</a></span>
15
+ <span class="buttons">
16
+ <a class="icon-pencil" href="/remap/edit?id=#{map[:id]}" title="Edit"></a>
17
+ <a class="icon-trash" href="/remap/delete?id=#{map[:id]}" title="Delete"></a>
18
+ </span>
19
+ </li>
20
+ <?r end ?>
21
+ </ul>
22
+ </p>
23
+ </div>
metadata ADDED
@@ -0,0 +1,124 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ts-admin
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Florian Schwab
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-05-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
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: ramaze
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: 2.0.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: 2.0.0
55
+ description: Frontend for managing ATS remap configuration
56
+ email:
57
+ - florian.schwab@sic-software.com
58
+ executables:
59
+ - ts-admin
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - .gitignore
64
+ - Gemfile
65
+ - Gemfile.lock
66
+ - LICENSE.txt
67
+ - README.md
68
+ - Rakefile
69
+ - app.rb
70
+ - app.yml.example
71
+ - bin/ts-admin
72
+ - config.ru
73
+ - controller/init.rb
74
+ - controller/main.rb
75
+ - controller/remap.rb
76
+ - layout/default.xhtml
77
+ - lib/ts-admin.rb
78
+ - lib/ts-admin/traffic_server.rb
79
+ - lib/ts-admin/version.rb
80
+ - public/css/font-awesome.min.css
81
+ - public/css/grid.css
82
+ - public/css/layout.css
83
+ - public/css/reset.css
84
+ - public/css/text.css
85
+ - public/favicon.ico
86
+ - public/font/FontAwesome.otf
87
+ - public/font/fontawesome-webfont.eot
88
+ - public/font/fontawesome-webfont.svg
89
+ - public/font/fontawesome-webfont.ttf
90
+ - public/font/fontawesome-webfont.woff
91
+ - public/images/bg.png
92
+ - spec/helper.rb
93
+ - task/ramaze.rake
94
+ - ts-admin.gemspec
95
+ - view/index.xhtml
96
+ - view/remap/form.xhtml
97
+ - view/remap/index.xhtml
98
+ - view/remap/list.xhtml
99
+ homepage: http://www.sic-software.com/
100
+ licenses:
101
+ - MIT
102
+ metadata: {}
103
+ post_install_message:
104
+ rdoc_options: []
105
+ require_paths:
106
+ - lib
107
+ required_ruby_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ required_rubygems_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - '>='
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ requirements: []
118
+ rubyforge_project:
119
+ rubygems_version: 2.0.3
120
+ signing_key:
121
+ specification_version: 4
122
+ summary: Frontend for managing ATS remap configuration
123
+ test_files:
124
+ - spec/helper.rb