Sha256: 91f3a73242d44d89fe7109bfe76924903a52fcf3bed09885079d5510d7af9533
Contents?: true
Size: 499 Bytes
Versions: 10
Compression:
Stored size: 499 Bytes
Contents
#!/usr/bin/env ruby require 'bundler' require 'fileutils' # add files to lib and spec # takes one arg, the path from lib/spec + base filename # example: add models/something unless ARGV[0] puts "example: add models/something" exit end file = ARGV[0].dup root = Bundler.root.split.last.to_s file.chomp!(".rb") lib = "lib/#{root}/#{file}.rb" spec = "spec/#{root}/#{file}_spec.rb" [lib, spec].each do |s| FileUtils.mkdir_p(File.dirname(s)) puts "created: #{FileUtils.touch(s).first}" end
Version data entries
10 entries across 10 versions & 3 rubygems