visage-app 2.0.2 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ 2.0.4 - 2012/03/27
2
+ - Add extra input validation in the builder, so invalid data can't be entered
3
+ into `profiles.yaml`, per [issue 92](https://github.com/auxesis/visage/issues/92)
4
+
1
5
  2.0.2 - 2012/03/26
2
6
  - Builder bugfix for [issue 92](https://github.com/auxesis/visage/issues/92),
3
7
  that stopped the builder from presenting the save profile dialog.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- visage-app (2.0.2)
4
+ visage-app (2.0.4)
5
5
  errand (= 0.7.3)
6
6
  haml (= 3.1.4)
7
7
  sinatra (= 1.3.2)
@@ -12,6 +12,7 @@ GEM
12
12
  remote: http://rubygems.org/
13
13
  specs:
14
14
  builder (3.0.0)
15
+ colorize (0.5.8)
15
16
  cucumber (1.1.9)
16
17
  builder (>= 2.1.2)
17
18
  diff-lcs (>= 1.1.2)
@@ -56,6 +57,7 @@ PLATFORMS
56
57
  ruby
57
58
 
58
59
  DEPENDENCIES
60
+ colorize
59
61
  cucumber
60
62
  rack-test
61
63
  rspec
data/Rakefile CHANGED
@@ -4,13 +4,17 @@ require 'rubygems'
4
4
  require 'bundler/setup'
5
5
  require 'cucumber'
6
6
  require 'cucumber/rake/task'
7
+ require 'colorize'
8
+ require 'pathname'
9
+ $: << Pathname.new(__FILE__).join('lib').expand_path.to_s
10
+ require 'visage-app/version'
7
11
 
8
12
  Cucumber::Rake::Task.new(:features) do |t|
9
13
  t.cucumber_opts = "features --format pretty"
10
14
  end
11
15
 
12
16
  desc "build gem"
13
- task :build => :lintian do
17
+ task :build => :verify do
14
18
  build_output = `gem build visage-app.gemspec`
15
19
  puts build_output
16
20
 
@@ -19,7 +23,7 @@ task :build => :lintian do
19
23
  FileUtils.mkdir_p(pkg_path)
20
24
  FileUtils.mv(gem_filename, pkg_path)
21
25
 
22
- puts "Gem built in #{pkg_path}/#{gem_filename}"
26
+ puts "Gem built in #{pkg_path}/#{gem_filename}".green
23
27
  end
24
28
 
25
29
  desc "push gem"
@@ -36,26 +40,6 @@ task :push do
36
40
  system(command)
37
41
  end
38
42
 
39
- desc "perform lintian checks on the JavaScript about to be shipped"
40
- task :lintian do
41
- @count = 0
42
- require 'pathname'
43
- @root = Pathname.new(File.dirname(__FILE__)).expand_path
44
- javascripts_path = @root.join('lib/visage-app/public/javascripts')
45
-
46
- javascripts = Dir.glob("#{javascripts_path + "*"}.js").reject {|f| f =~ /mootools|src\.js/ }
47
- javascripts.each do |filename|
48
- puts "Checking #{filename}"
49
- count = `grep -c 'console.log' #{filename}`.strip.to_i
50
- if count > 0
51
- puts "#{count} instances of console.log found in #{File.basename(filename)}"
52
- @count += 1
53
- end
54
- end
55
-
56
- abort if @count > 0
57
- end
58
-
59
43
  desc "clean up various generated files"
60
44
  task :clean do
61
45
  [ "webrat.log", "pkg/", "_site/"].each do |filename|
@@ -63,3 +47,50 @@ task :clean do
63
47
  FileUtils.rm_rf(filename)
64
48
  end
65
49
  end
50
+
51
+ namespace :verify do
52
+ desc "perform lintian checks on the JavaScript about to be shipped"
53
+ task :lintian do
54
+ @count = 0
55
+ require 'pathname'
56
+ @root = Pathname.new(File.dirname(__FILE__)).expand_path
57
+ javascripts_path = @root.join('lib/visage-app/public/javascripts')
58
+
59
+ javascripts = Dir.glob("#{javascripts_path + "*"}.js").reject {|f| f =~ /mootools|src\.js/ }
60
+ javascripts.each do |filename|
61
+ puts "Checking #{filename}".green
62
+ count = `grep -c 'console.log' #{filename}`.strip.to_i
63
+ if count > 0
64
+ puts "#{count} instances of console.log found in #{File.basename(filename)}".red
65
+ @count += 1
66
+ end
67
+ end
68
+
69
+ abort if @count > 0
70
+ end
71
+
72
+ task :changelog do
73
+ changelog_filename = "CHANGELOG.md"
74
+ version = Visage::VERSION
75
+
76
+ if not system("grep ^#{version} #{changelog_filename} 2>&1 >/dev/null")
77
+ puts "#{changelog_filename} doesn't have an entry for the version you are about to build.".red
78
+ exit 1
79
+ end
80
+ end
81
+
82
+ task :uncommitted do
83
+ uncommitted = `git ls-files -m`.split("\n")
84
+ if uncommitted.size > 0
85
+ puts "The following files are uncommitted:".red
86
+ uncommitted.each do |filename|
87
+ puts " - #{filename}".red
88
+ end
89
+ exit 1
90
+ end
91
+ end
92
+
93
+ task :all => [ :lintian, :changelog, :uncommitted ]
94
+ end
95
+
96
+ task :verify => 'verify:all'
@@ -523,11 +523,25 @@ var ChartBuilder = new Class({
523
523
  show.addEvent('click', function(e) {
524
524
  e.stop();
525
525
 
526
- this.showGraphs();
527
526
 
528
- // Fade the save button once graphs have been rendered.
529
- this.save.fade.delay(1500, this.save, 'in')
530
- this.profile_name.fade.delay(1500, this.profile_name, 'in')
527
+ var hosts = $(this.searchers.host).getElements("div.token.finalized"),
528
+ metrics = $(this.searchers.metric).getElements("div.token.finalized");
529
+
530
+ if (hosts.length > 0 && metrics.length > 0) {
531
+ this.showGraphs();
532
+ // Fade the save button once graphs have been rendered.
533
+ this.save.fade.delay(1500, this.save, 'in')
534
+ this.profile_name.fade.delay(1500, this.profile_name, 'in')
535
+ } else {
536
+ new Message({
537
+ title: 'Oops!',
538
+ message: 'You need to specify some hosts and metrics before you can show graphs.',
539
+ top: true,
540
+ iconPath: '/images/',
541
+ icon: 'caution.png',
542
+ }).say();
543
+ }
544
+
531
545
  }.bind(this));
532
546
 
533
547
  },
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  module Visage
4
- VERSION = "2.0.2"
4
+ VERSION = "2.0.4"
5
5
  end
data/visage-app.gemspec CHANGED
@@ -33,4 +33,5 @@ Gem::Specification.new do |s|
33
33
  s.add_development_dependency "rspec", ">= 0"
34
34
  s.add_development_dependency "cucumber", ">= 0"
35
35
  s.add_development_dependency "webrat", ">= 0"
36
+ s.add_development_dependency "colorize", ">= 0"
36
37
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 0
8
- - 2
9
- version: 2.0.2
8
+ - 4
9
+ version: 2.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Lindsay Holmwood
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-03-25 00:00:00 +11:00
17
+ date: 2012-03-26 00:00:00 +11:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -147,6 +147,18 @@ dependencies:
147
147
  - 0
148
148
  version: "0"
149
149
  requirement: *id010
150
+ - !ruby/object:Gem::Dependency
151
+ prerelease: false
152
+ name: colorize
153
+ type: :development
154
+ version_requirements: &id011 !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ segments:
159
+ - 0
160
+ version: "0"
161
+ requirement: *id011
150
162
  description: Visage is a web interface for viewing collectd statistics. It also provides a JSON interface onto collectd's RRD data, giving you an easy way to mash up the data.
151
163
  email:
152
164
  - lindsay@holmwood.id.au