Sha256: 79627b36818919909c5a21242f02571a9abdca7a742c5082e1a39f6730917458

Contents?: true

Size: 1.26 KB

Versions: 5

Compression:

Stored size: 1.26 KB

Contents

require "bundler"
Bundler::GemHelper.install_tasks

task :default do
  sh "rspec spec/"
end

desc "Convert a plist to a .syntax file"
task :convert, :in, :out do |t,args|
  convert(args[:in], args[:out] || 'out.syntax')
end

rule /^version:bump:.*/ do |t|
  sh "git status | grep 'nothing to commit'" # ensure we are not dirty
  index = ['major', 'minor','patch'].index(t.name.split(':').last)
  file = 'lib/textpow/version.rb'

  version_file = File.read(file)
  old_version, *version_parts = version_file.match(/(\d+)\.(\d+)\.(\d+)/).to_a
  version_parts[index] = version_parts[index].to_i + 1
  new_version = version_parts * '.'
  File.open(file,'w'){|f| f.write(version_file.sub(old_version, new_version)) }

  sh "bundle && git add #{file} Gemfile.lock && git commit -m 'bump version to #{new_version}'"
end

desc "update syntaxes from their original source"
task :update_syntax do
  {
    'source.scss' => 'https://raw.github.com/kuroir/SCSS.tmbundle/master/Syntaxes/SCSS.tmLanguage'
  }.each do |scope_name, url|
    `curl '#{url}' > temp.plist`
    convert('temp.plist', "lib/textpow/syntax/#{scope_name}.syntax")
    `rm temp.plist`
  end
end

def convert(from, to)
  require 'plist'
  require 'yaml'
  yaml = Plist.parse_xml(from).to_yaml
  File.open(to,'w'){|f| f.write(yaml) }
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
textpow1x-1.2.5 Rakefile
textpow1x-1.2.4 Rakefile
textpow1x-1.2.3 Rakefile
textpow1x-1.2.2 Rakefile
textpow1x-1.2.1 Rakefile