oxidized-web 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of oxidized-web might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d6d01a9cc5ccc9c98d97a28166667c205f32286
4
- data.tar.gz: 4a87180d8b75f7c94a1d5135296e31e60bd2ab97
3
+ metadata.gz: b110dab12b4cab01fcf16a030447b672d7e9f1b0
4
+ data.tar.gz: 4527869b82a903d1f466ae012488923d3368fdd1
5
5
  SHA512:
6
- metadata.gz: 56238ef9618517581efbdb29d9309ab02cf6d41210f1511c147bf6d33224a019fe2508b08cd35cf9eea31bcae203f47a3a59232e2d4fa8cd2c707d7e26b85002
7
- data.tar.gz: 9cd62137cd2ce3b23302de68d3ae750829abca616bc469df3c18db14c8c3d8e68e22d110ba6ef104502e9790459e75b3c6f5533d39ec4b89c178ec3f2dd9c330
6
+ metadata.gz: dbad3adcb6828d522f0a2d3898dc0e7f63469f414ae9bad8c8836518deff71c3870880672022afc3245b91d5532d1622cc4e7810e96f109cb1ce9bdfd0cef397
7
+ data.tar.gz: da4959a59533f5e22d84cc7a7d3e702e27aff6760f182c12cce8e67e50184dbee48c6a145d8113f4bd712e0bbb6019a0eeafdbb3e1c7452d02e381ce77f15d9f
@@ -1,8 +1,8 @@
1
1
  require 'sinatra/base'
2
2
  require 'sinatra/json'
3
3
  require 'sinatra/url_for'
4
- require 'haml'
5
- require 'sass'
4
+ require 'tilt/haml'
5
+ require 'tilt/sass'
6
6
  require 'pp'
7
7
  require 'oxidized/web/mig'
8
8
  module Oxidized
@@ -10,7 +10,7 @@ module Oxidized
10
10
  class WebApp < Sinatra::Base
11
11
  helpers Sinatra::UrlForHelper
12
12
  set :public_folder, Proc.new { File.join(root, "public") }
13
-
13
+
14
14
  get '/' do
15
15
  redirect url_for('/nodes')
16
16
  end
@@ -28,8 +28,8 @@ module Oxidized
28
28
  end
29
29
  out :nodes
30
30
  end
31
-
32
- post '/nodes/conf_search' do
31
+
32
+ post '/nodes/conf_search' do
33
33
  @to_research = params[:search_in_conf_textbox]
34
34
  nodes_list = nodes.list.map
35
35
  @nodes_match = []
@@ -99,12 +99,12 @@ module Oxidized
99
99
  @data = nodes.show node
100
100
  out :node
101
101
  end
102
-
102
+
103
103
  #redirect to the web page for rancid - oxidized migration
104
104
  get '/migration' do
105
105
  out :migration
106
106
  end
107
-
107
+
108
108
  #get the files send
109
109
  post '/migration' do
110
110
  number = params[:number].to_i
@@ -112,7 +112,7 @@ module Oxidized
112
112
  path_new_file = params['path_new_file']
113
113
 
114
114
  router_db_files = Array.new
115
-
115
+
116
116
  i = 1
117
117
  while i <= number do
118
118
  router_db_files.push({:file=>(params["file"+i.to_s][:tempfile]), :group=>params["group"+i.to_s]})
@@ -122,13 +122,13 @@ module Oxidized
122
122
  migration = Mig.new(router_db_files, cloginrc_file, path_new_file)
123
123
  migration.go_rancid_migration
124
124
  redirect url_for("//nodes")
125
-
125
+
126
126
  end
127
-
127
+
128
128
  get '/css/*.css' do
129
129
  sass "sass/#{params[:splat].first}".to_sym
130
130
  end
131
-
131
+
132
132
  #show the lists of versions for a node
133
133
  get '/node/version.?:format?' do
134
134
  @data = nil
@@ -146,7 +146,7 @@ module Oxidized
146
146
  end
147
147
  out :versions
148
148
  end
149
-
149
+
150
150
  #show the blob of a version
151
151
  get '/node/version/view.?:format?' do
152
152
  node, @json = route_parse :node
@@ -154,7 +154,7 @@ module Oxidized
154
154
  @data = nodes.get_version node, @info[:group], @info[:oid]
155
155
  out :version
156
156
  end
157
-
157
+
158
158
  #show diffs between 2 version
159
159
  get '/node/version/diffs' do
160
160
  node, @json = route_parse :node
@@ -191,12 +191,12 @@ module Oxidized
191
191
  @diff = diff_view @data
192
192
  out :diffs
193
193
  end
194
-
194
+
195
195
  #used for diff between 2 distant commit
196
196
  post '/node/version/diffs' do
197
197
  redirect url_for("/node/version/diffs?node=#{params[:node]}&group=#{params[:group]}&oid=#{params[:oid]}&date=#{params[:date]}&num=#{params[:num]}&oid2=#{params[:oid2]}")
198
198
  end
199
-
199
+
200
200
  private
201
201
 
202
202
  def out template=:default
@@ -231,7 +231,7 @@ module Oxidized
231
231
  end
232
232
  [e.join('.'), json]
233
233
  end
234
-
234
+
235
235
  #give the time enlapsed between now and a date
236
236
  def time_from_now date
237
237
  if date
@@ -255,12 +255,12 @@ module Oxidized
255
255
  end
256
256
  date
257
257
  end
258
-
258
+
259
259
  #method the give diffs in separate view (the old and the new) as in github
260
260
  def diff_view diff
261
261
  old_diff = []
262
262
  new_diff = []
263
-
263
+
264
264
  diff.each_line do |line|
265
265
  if /^\+/.match(line)
266
266
  new_diff.push(line)
@@ -271,7 +271,7 @@ module Oxidized
271
271
  old_diff.push(line)
272
272
  end
273
273
  end
274
-
274
+
275
275
  length_o = old_diff.count
276
276
  length_n = new_diff.count
277
277
  for i in 0..[length_o, length_n].max
@@ -292,7 +292,7 @@ module Oxidized
292
292
  length_o += 1
293
293
  end
294
294
  end
295
- both_diff = {:old_diff => old_diff, :new_diff => new_diff}
295
+ {:old_diff => old_diff, :new_diff => new_diff}
296
296
  end
297
297
  end
298
298
  end
data/oxidized-web.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'oxidized-web'
3
- s.version = '0.5.0'
3
+ s.version = '0.5.1'
4
4
  s.licenses = %w( Apache-2.0 )
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = [ 'Saku Ytti', 'Samer Abdel-Hafez' ]
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.require_path = 'lib'
15
15
 
16
16
  s.required_ruby_version = '>= 1.9.3'
17
- s.add_runtime_dependency 'oxidized', '~> 0.2'
17
+ s.add_runtime_dependency 'oxidized', '~> 0.8'
18
18
  s.add_runtime_dependency 'puma', '~> 2.8'
19
19
  s.add_runtime_dependency 'sinatra', '~> 1.4'
20
20
  s.add_runtime_dependency 'sinatra-contrib', '~> 1.4'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oxidized-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saku Ytti
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-09-14 00:00:00.000000000 Z
12
+ date: 2015-09-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oxidized
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '0.2'
20
+ version: '0.8'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '0.2'
27
+ version: '0.8'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: puma
30
30
  requirement: !ruby/object:Gem::Requirement