Skip to content

Commit

Permalink
Merge pull request #588 from ethn/0_11
Browse files Browse the repository at this point in the history
decko gem cleanup for release
  • Loading branch information
ethn authored Dec 24, 2020
2 parents 184e15b + 9785b5e commit 466bebc
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 26 deletions.
7 changes: 3 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require "./decko_gem"
# developers. Therefore they should contain only tasks for core developers.

task :push_gems do
# push_main_gems
push_main_gems
push_mod_gems
end

Expand Down Expand Up @@ -37,12 +37,11 @@ def push_main_gems
end

def push_mod_gems
%w(edit ace_editor prosemirror_editor tinymce_editor date recaptcha).each do |gem|
gem = "card-mod-#{gem}"
Dir.glob("card-mod-*").each do |gem|
system %(cd #{gem}; #{push_gem gem, version})
end
end

def version
DeckoGem.version
DeckoGem.decko_version
end
52 changes: 30 additions & 22 deletions decko_gem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,36 @@ def gem name, mod=false
def mod name, &block
gem name, true, &block
end
end

def initialize spec
@spec = spec
end
def decko_version
VERSION
end

def decko_version
VERSION
def card_version
@card_version ||= [1, minor, point].compact.map(&:to_s).join "."
end

private

def bits
@bits ||= decko_version.split(".").map(&:to_i)
end

def major
bits[0]
end

def minor
CARD_MINOR[major] + bits[1]
end

def point
bits[2]
end
end

def card_version
[1, minor, point].compact.map(&:to_s).join "."
def initialize spec
@spec = spec
end

def shared
Expand All @@ -57,21 +75,11 @@ def depends_on_mod *mods
mods.each { |mod| spec.add_runtime_dependency "card-mod-#{mod}", decko_version }
end

private

def bits
@bits ||= decko_version.split(".").map(&:to_i)
end

def major
bits[0]
end

def minor
CARD_MINOR[major] + bits[1]
def decko_version
DeckoGem.decko_version
end

def point
bits[2]
def card_version
DeckoGem.card_version
end
end

0 comments on commit 466bebc

Please sign in to comment.