From 545e1fe086c2df69ebf45c6b2f6a61932a5b6637 Mon Sep 17 00:00:00 2001 From: telyn Date: Wed, 24 Jan 2018 12:58:35 +0000 Subject: rip out the require 'locale' --- lib/mauve/sender.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/mauve/sender.rb b/lib/mauve/sender.rb index e6cc4dd..29c085b 100644 --- a/lib/mauve/sender.rb +++ b/lib/mauve/sender.rb @@ -1,11 +1,11 @@ # encoding: UTF-8 require 'ipaddr' require 'socket' -begin - require 'locale' -rescue LoadError +#begin +# require 'locale' +#rescue LoadError # Do nothing -- these are bonus libraries :) -end +#end require 'mauve/mauve_resolv' require 'mauve/mauve_time' -- cgit v1.2.1 From d9946b8c3fdddb95f4cb7457abf163afd65bee6b Mon Sep 17 00:00:00 2001 From: telyn Date: Thu, 25 Jan 2018 11:14:03 +0000 Subject: add codeclimate job and build thegem --- .gitlab-ci.yml | 22 +++++++++++++++++++ mauve.gemspec | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 mauve.gemspec diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 07b992b..967e78e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,17 @@ stages: - package - publish +codeclimate: + image: $CI_REGISTRY/docker-images/layers:stretch-codeclimate + stage: test + tags: + - docker-socket + script: + - codeclimate analyze -f json > codeclimate.json + artifacts: + paths: [codeclimate.json] + + .test: &test image: $CI_REGISTRY/docker-images/layers:$DISTRO-ruby stage: test @@ -38,6 +49,17 @@ test:stretch: paths: - pkg/ +package:gem: + stage: package + image: $CI_REGISTRY/docker-images/layers:jessie-ruby + artifacts: + paths: + - pkg + script: + - package + variables: + GEMFILE: mauve.gemspec + package:jessie: <<: *package variables: diff --git a/mauve.gemspec b/mauve.gemspec new file mode 100644 index 0000000..01515f1 --- /dev/null +++ b/mauve.gemspec @@ -0,0 +1,68 @@ + +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'mauve/version' + +Gem::Specification.new do |spec| + spec.name = 'mauve' + spec.version = Mauve::VERSION + spec.authors = ['Patrick Cherry', 'Telyn Roat'] + spec.email = ['telyn@bytemark.co.uk'] + + spec.summary = 'an alert system for system and network administrators to help you sleep better, and be attentive to your computers.' + spec.homepage = 'https://github.com/BytemarkHosting/mauvealert' + + # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' + # to allow pushing to a single host or delete this section to allow pushing to any host. + if spec.respond_to?(:metadata) + spec.metadata['allowed_push_host'] = 'http://src.bytemark.co.uk' + else + raise 'RubyGems 2.0 or newer is required to protect against ' \ + 'public gem pushes.' + end + + spec.files = `git ls-files -z`.split("\x0").reject do |f| + f.match(%r{^(test|spec|features)/}) + end + spec.bindir = 'exe' + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.require_paths = ['lib'] + + spec.add_development_dependency 'bundler', '~> 1.16' + spec.add_development_dependency 'rake', '~> 10.0' + + spec.add_runtime_dependency 'datamapper' + spec.add_runtime_dependency 'dm-aggregates' + spec.add_runtime_dependency 'dm-do-adapter' + spec.add_runtime_dependency 'dm-migrations' + spec.add_runtime_dependency 'dm-postgres-adapter' + spec.add_runtime_dependency 'dm-sqlite-adapter' + spec.add_runtime_dependency 'dm-transactions' + spec.add_runtime_dependency 'dm-types' + spec.add_runtime_dependency 'dm-validations' + spec.add_runtime_dependency 'ruby_protobuf', '~> 0.4.11' + + # + # The versions here are to match Jessie + # + spec.add_runtime_dependency 'haml', '~> 4.0.5' + spec.add_runtime_dependency 'haml-contrib', '~> 1.0.0' + spec.add_runtime_dependency 'ipaddress', '~> 0.8.0' + spec.add_runtime_dependency 'json', '~> 1.8.1' + spec.add_runtime_dependency 'locale', '~> 2.1.0' + spec.add_runtime_dependency 'log4r', '~> 1.1.10' + spec.add_runtime_dependency 'rack', '~> 1.5.2' + spec.add_runtime_dependency 'rack-flash3', '~> 1.0.5' + spec.add_runtime_dependency 'rack-protection', '~> 1.5.2' + spec.add_runtime_dependency 'RedCloth', '~> 4.2.9' + spec.add_runtime_dependency 'rmail', '~> 1.1.0' + spec.add_runtime_dependency 'sanitize', '~> 2.1.0' + spec.add_runtime_dependency 'sinatra', '~> 1.4.5' + spec.add_runtime_dependency 'thin', '~> 1.6.3' + spec.add_runtime_dependency 'tilt', '~> 1.4.1' + + spec.add_development_dependency 'rack-test', '~> 0.6.3' + spec.add_development_dependency 'simplecov' + spec.add_development_dependency 'timecop', '~> 0.7.1' + spec.add_development_dependency 'webmock', '~> 1.19.0' +end -- cgit v1.2.1 From 246397691f55609e7ddd2d237a18465a90f80ebd Mon Sep 17 00:00:00 2001 From: telyn Date: Thu, 25 Jan 2018 11:18:35 +0000 Subject: ok i guess codeclimate can be done later --- .gitlab-ci.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 967e78e..ce3ea71 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,17 +3,6 @@ stages: - package - publish -codeclimate: - image: $CI_REGISTRY/docker-images/layers:stretch-codeclimate - stage: test - tags: - - docker-socket - script: - - codeclimate analyze -f json > codeclimate.json - artifacts: - paths: [codeclimate.json] - - .test: &test image: $CI_REGISTRY/docker-images/layers:$DISTRO-ruby stage: test -- cgit v1.2.1 From 5d10d99339dd85d2b6498d9cbffe37b32308db17 Mon Sep 17 00:00:00 2001 From: telyn Date: Thu, 25 Jan 2018 11:35:06 +0000 Subject: fix executables dir, stop shelling out to git --- mauve.gemspec | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mauve.gemspec b/mauve.gemspec index 01515f1..3e1bc4c 100644 --- a/mauve.gemspec +++ b/mauve.gemspec @@ -21,11 +21,9 @@ Gem::Specification.new do |spec| 'public gem pushes.' end - spec.files = `git ls-files -z`.split("\x0").reject do |f| - f.match(%r{^(test|spec|features)/}) - end - spec.bindir = 'exe' - spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.files = Dir['**/*'] + spec.bindir = 'bin' + spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.require_paths = ['lib'] spec.add_development_dependency 'bundler', '~> 1.16' -- cgit v1.2.1 From 0139aa17ab739365745c3447de5634b665391a77 Mon Sep 17 00:00:00 2001 From: telyn Date: Mon, 29 Jan 2018 11:29:34 +0000 Subject: Make a minimal mauvesend gem --- .gitlab-ci.yml | 2 +- mauve.gemspec | 66 ------------------------------------------------------- mauvesend.gemspec | 44 +++++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 67 deletions(-) delete mode 100644 mauve.gemspec create mode 100644 mauvesend.gemspec diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ce3ea71..cf424a4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,7 +47,7 @@ package:gem: script: - package variables: - GEMFILE: mauve.gemspec + GEMFILE: mauvesend.gemspec package:jessie: <<: *package diff --git a/mauve.gemspec b/mauve.gemspec deleted file mode 100644 index 3e1bc4c..0000000 --- a/mauve.gemspec +++ /dev/null @@ -1,66 +0,0 @@ - -lib = File.expand_path('../lib', __FILE__) -$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'mauve/version' - -Gem::Specification.new do |spec| - spec.name = 'mauve' - spec.version = Mauve::VERSION - spec.authors = ['Patrick Cherry', 'Telyn Roat'] - spec.email = ['telyn@bytemark.co.uk'] - - spec.summary = 'an alert system for system and network administrators to help you sleep better, and be attentive to your computers.' - spec.homepage = 'https://github.com/BytemarkHosting/mauvealert' - - # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' - # to allow pushing to a single host or delete this section to allow pushing to any host. - if spec.respond_to?(:metadata) - spec.metadata['allowed_push_host'] = 'http://src.bytemark.co.uk' - else - raise 'RubyGems 2.0 or newer is required to protect against ' \ - 'public gem pushes.' - end - - spec.files = Dir['**/*'] - spec.bindir = 'bin' - spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } - spec.require_paths = ['lib'] - - spec.add_development_dependency 'bundler', '~> 1.16' - spec.add_development_dependency 'rake', '~> 10.0' - - spec.add_runtime_dependency 'datamapper' - spec.add_runtime_dependency 'dm-aggregates' - spec.add_runtime_dependency 'dm-do-adapter' - spec.add_runtime_dependency 'dm-migrations' - spec.add_runtime_dependency 'dm-postgres-adapter' - spec.add_runtime_dependency 'dm-sqlite-adapter' - spec.add_runtime_dependency 'dm-transactions' - spec.add_runtime_dependency 'dm-types' - spec.add_runtime_dependency 'dm-validations' - spec.add_runtime_dependency 'ruby_protobuf', '~> 0.4.11' - - # - # The versions here are to match Jessie - # - spec.add_runtime_dependency 'haml', '~> 4.0.5' - spec.add_runtime_dependency 'haml-contrib', '~> 1.0.0' - spec.add_runtime_dependency 'ipaddress', '~> 0.8.0' - spec.add_runtime_dependency 'json', '~> 1.8.1' - spec.add_runtime_dependency 'locale', '~> 2.1.0' - spec.add_runtime_dependency 'log4r', '~> 1.1.10' - spec.add_runtime_dependency 'rack', '~> 1.5.2' - spec.add_runtime_dependency 'rack-flash3', '~> 1.0.5' - spec.add_runtime_dependency 'rack-protection', '~> 1.5.2' - spec.add_runtime_dependency 'RedCloth', '~> 4.2.9' - spec.add_runtime_dependency 'rmail', '~> 1.1.0' - spec.add_runtime_dependency 'sanitize', '~> 2.1.0' - spec.add_runtime_dependency 'sinatra', '~> 1.4.5' - spec.add_runtime_dependency 'thin', '~> 1.6.3' - spec.add_runtime_dependency 'tilt', '~> 1.4.1' - - spec.add_development_dependency 'rack-test', '~> 0.6.3' - spec.add_development_dependency 'simplecov' - spec.add_development_dependency 'timecop', '~> 0.7.1' - spec.add_development_dependency 'webmock', '~> 1.19.0' -end diff --git a/mauvesend.gemspec b/mauvesend.gemspec new file mode 100644 index 0000000..d6312e4 --- /dev/null +++ b/mauvesend.gemspec @@ -0,0 +1,44 @@ + +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'mauve/version' + +Gem::Specification.new do |spec| + spec.name = 'mauvesend' + spec.version = Mauve::VERSION + spec.authors = ['Patrick Cherry', 'Telyn Roat'] + spec.email = ['telyn@bytemark.co.uk'] + + spec.summary = 'an alert system for system and network administrators to help you sleep better, and be attentive to your computers.' + spec.homepage = 'https://github.com/BytemarkHosting/mauvealert' + + # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' + # to allow pushing to a single host or delete this section to allow pushing to any host. + if spec.respond_to?(:metadata) + spec.metadata['allowed_push_host'] = 'http://src.bytemark.co.uk' + else + raise 'RubyGems 2.0 or newer is required to protect against ' \ + 'public gem pushes.' + end + + spec.files = %w[ + lib/mauve/sender.rb + lib/mauve/mauve_resolv.rb + lib/mauve/mauve_time.rb + lib/mauve/version.rb + lib/mauve/proto.rb + mauve.proto + ] + + spec.bindir = 'bin' + spec.executables = 'mauvesend' + spec.require_paths = ['lib'] + + spec.add_development_dependency 'bundler', '~> 1.16' + spec.add_development_dependency 'rake', '~> 10.0' + + spec.add_runtime_dependency 'ruby_protobuf', '~> 0.4.11' + + # + # The versions here are to match Jessie +end -- cgit v1.2.1 From a3372ff012444a5c330e0f6865851462bcfcea01 Mon Sep 17 00:00:00 2001 From: telyn Date: Mon, 29 Jan 2018 14:33:09 +0000 Subject: remove all mention of Locale --- lib/mauve/sender.rb | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lib/mauve/sender.rb b/lib/mauve/sender.rb index 29c085b..7a965ab 100644 --- a/lib/mauve/sender.rb +++ b/lib/mauve/sender.rb @@ -1,11 +1,6 @@ # encoding: UTF-8 require 'ipaddr' require 'socket' -#begin -# require 'locale' -#rescue LoadError - # Do nothing -- these are bonus libraries :) -#end require 'mauve/mauve_resolv' require 'mauve/mauve_time' @@ -152,13 +147,6 @@ module Mauve # `nil` doesn't work. update.replace ||= false - # - # Check the locale charset. This is to maximise the amout of information - # mauve receives, rather than provide proper sanitized data for the server. - # - from_charset = (Locale.current.charset || Locale.charset) if defined?(Locale) - from_charset ||= "UTF-8" - # # # -- cgit v1.2.1 From fa9b1e69d7835bce47990648c6d01fc3f67fcded Mon Sep 17 00:00:00 2001 From: telyn Date: Mon, 29 Jan 2018 15:36:25 +0000 Subject: Add changelog entry & remove locale from gemfile --- Gemfile | 2 +- Gemfile.lock | 22 +++++++++++----------- debian/changelog | 3 +++ debian/control | 2 -- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Gemfile b/Gemfile index 8acb3ba..4fc00ac 100644 --- a/Gemfile +++ b/Gemfile @@ -28,9 +28,9 @@ gem "rack-protection", "~> 1.5.2" gem "rack-flash3", "~> 1.0.5" gem "tilt", "~> 1.4.1" gem "sinatra", "~> 1.4.5" -gem "locale", "~> 2.1.0" group :test do + gem "locale", "~> 2.1.0" gem "simplecov", :require => false gem "rack-test", "~> 0.6.3" gem "webmock", "~> 1.19.0" diff --git a/Gemfile.lock b/Gemfile.lock index 716949f..21cdb41 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,14 +2,14 @@ GEM remote: https://rubygems.org/ specs: RedCloth (4.2.9) - addressable (2.5.1) - public_suffix (~> 2.0, >= 2.0.2) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) bcrypt (3.1.11) bcrypt-ruby (3.1.5) bcrypt (>= 3.1.3) crack (0.4.3) safe_yaml (~> 1.0.0) - daemons (1.2.4) + daemons (1.2.6) data_objects (0.10.17) addressable (~> 2.1) datamapper (1.2.0) @@ -75,11 +75,11 @@ GEM json_pure (1.8.6) locale (2.1.2) log4r (1.1.10) - mini_portile2 (2.2.0) - multi_json (1.12.1) - nokogiri (1.8.0) - mini_portile2 (~> 2.2.0) - public_suffix (2.0.5) + mini_portile2 (2.3.0) + multi_json (1.13.1) + nokogiri (1.8.2) + mini_portile2 (~> 2.3.0) + public_suffix (3.0.1) rack (1.5.5) rack-flash3 (1.0.5) rack @@ -92,11 +92,11 @@ GEM safe_yaml (1.0.4) sanitize (2.1.0) nokogiri (>= 1.4.4) - simplecov (0.14.1) + simplecov (0.15.1) docile (~> 1.1.0) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) - simplecov-html (0.10.1) + simplecov-html (0.10.2) sinatra (1.4.8) rack (~> 1.5) rack-protection (~> 1.4) @@ -148,4 +148,4 @@ DEPENDENCIES webmock (~> 1.19.0) BUNDLED WITH - 1.13.6 + 1.16.0 diff --git a/debian/changelog b/debian/changelog index e4d42d3..b436c88 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,9 @@ mauvealert (3.16.0) UNRELEASED; urgency=medium * Make authentication work for AJAX requests (#22, !3) * Change 'Events' nav item to load day list instead of calendar (#18, !3) + [ Telyn Roat] + * Removed need for locale gem outside of tests. (github pr #3) + -- Patrick J Cherry Mon, 01 Aug 2017 14:37:32 +0100 mauvealert (3.15.15-1) stable; urgency=medium diff --git a/debian/control b/debian/control index 5e913b3..41864f8 100644 --- a/debian/control +++ b/debian/control @@ -13,7 +13,6 @@ Architecture: any Pre-Depends: libjs-jquery Depends: adduser, lsb-base, ruby | ruby-interpreter, ruby-bundler, ${shlibs:Depends}, ${misc:Depends} Suggests: mauvealert-client -Recommends: ruby-locale | liblocale-ruby1.8 Description: Mauve network alert system -- server Mauve is a network alert system for system and network administrators. You can use it to quickly set up ad-hoc monitoring for a variety of services, and to @@ -25,7 +24,6 @@ Description: Mauve network alert system -- server Package: mauvealert-client Architecture: all Depends: ruby | ruby-interpreter, ruby-protobuf, ${misc:Depends} -Recommends: liblocale-ruby1.8 | ruby-locale Replaces: mauvealert-common Conflicts: mauvealert-common Provides: mauvealert-common -- cgit v1.2.1