fancybox2 0.0.7 → 0.0.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 771569623e40be10df4f7903ee6bde6b9523421e559f1ed05418932ba34da21e
4
- data.tar.gz: 15bfb48338dd6785ecabdd63dd0b714eefee51d7a18d2add44b0a43cb7d27acb
3
+ metadata.gz: 7d6fec49dcd588ebb60bc82f555240121134b3fcfc40747b63513795f50adf96
4
+ data.tar.gz: 5d683438d83ad32f12db66ab811da55864e3c0f801f6fb0eb7620d5bb35432a8
5
5
  SHA512:
6
- metadata.gz: 44ecd19a2239f7687496040045110b2274898c57f33721b63321877e1fffc7e2f2419abc56be3072126bd89e7b353068a5c15a0d10dddf5a85289746adcdb0c0
7
- data.tar.gz: eb42ba62b805b3e43fe51784d900021b81d779569365d5a617d07639635211013f23fd3c3538c81ac04a1eb7d2719d924fe06d29287728569c1332159287a709
6
+ metadata.gz: 22dcbb5bc7e731cc338ade1afe6023b706230526abeafef56655fe863f0e3314a622c8bab91eb3a2b788219026acb8151651be6deed4f4a616dfde5780338def
7
+ data.tar.gz: 49e4e79a91a552d4cb130c7c8cce4e037d6cf7c3314d38abaffc75167d3c1fac83fb0384ae850860df11c87de46e5caf278a0442df1e9f2e939b4cbfc1e71f19
@@ -3,14 +3,14 @@ module Fancybox2
3
3
  class Runner
4
4
  include Exceptions
5
5
 
6
- VERSION_REGEXP = /^(\d{14})/.freeze
6
+ VERSION_REGEXP = /^(\d+)/.freeze
7
7
 
8
8
  class << self
9
9
 
10
10
  def extract_and_validate_version_from(migration_name)
11
11
  version = migration_name.to_s.scan(VERSION_REGEXP).flatten.first
12
12
  unless version
13
- raise ArgumentError, 'migration version must be a 14 digits integer'
13
+ raise ArgumentError, 'migration name must start with an integer number e.g: 02_do_something.rb'
14
14
  end
15
15
 
16
16
  version.to_i
@@ -24,7 +24,7 @@ module Fancybox2
24
24
 
25
25
  load_migrations
26
26
  end
27
-
27
+
28
28
  # @param from a valid migration name or version
29
29
  # @param to a valid migration name or version
30
30
  def run(from: nil, to: nil)
@@ -40,13 +40,13 @@ module Fancybox2
40
40
 
41
41
  def load_migrations
42
42
  # Load files from files_path and create classes
43
- @migrations = Dir[File.join(File.expand_path(files_path), '**', '*.rb')].sort.map do |f_path|
44
- migration_name = File.basename(f_path)
43
+ @migrations = Dir[File.join(File.expand_path(files_path), '**', '*.rb')].map do |file_path|
44
+ migration_name = File.basename(file_path)
45
45
  klass = Class.new(Base)
46
- klass.class_eval(File.read(f_path), f_path)
46
+ klass.class_eval(File.read(file_path), file_path)
47
47
  klass.freeze
48
48
  klass.new migration_name
49
- end
49
+ end.sort_by { |migration| migration.version }
50
50
  end
51
51
 
52
52
  # Select migrations to run depending given a starting and an ending one
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fancybox2
4
- VERSION = '0.0.7'
4
+ VERSION = '0.0.8'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fancybox2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Verlato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-25 00:00:00.000000000 Z
11
+ date: 2021-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk