lib/storazzo.rb in storazzo-0.5.7 vs lib/storazzo.rb in storazzo-0.6.1
- old
+ new
@@ -1,23 +1,25 @@
+# frozen_string_literal: true
+
# Inspired from https://guides.rubygems.org/make-your-own-gem/#introduction
module Storazzo
# VERSION = File.read('./VERSION').chomp # "10.0.0"
# require 'storazzo/translator'
def latest_parser_version
- "1.2"
+ '1.2'
end
# Finds RAILS_ROOT for Storazzo Gem. Copied from:
# https://stackoverflow.com/questions/10132949/finding-the-gem-root
def self.root
- File.expand_path '../..', __FILE__
+ File.expand_path '..', __dir__
end
def self.version
- File.read(self.root + '/VERSION').chomp # "10.0.0"
+ File.read("#{root}/VERSION").chomp # "10.0.0"
end
# alias_method :VERSION, :version
def self.VERSION
version
@@ -28,15 +30,12 @@
end
end
# nice to paste nice output
require 'pp'
-require 'require_all'
-# require_all './' , 'media/'
-# require_all 'lib/**/*.rb'
# require_rel '.', 'media'
-Dir[File.dirname(__FILE__) + '/../lib/*.rb'].each do |file|
+Dir["#{File.dirname(__FILE__)}/../lib/*.rb"].each do |file|
puts "+ Requiring... #{file}"
require File.basename(file, File.extname(file))
end
require 'storazzo'