Add rest of file templates
This commit is contained in:
parent
a42c869d1d
commit
f05850767c
43 changed files with 1135 additions and 47 deletions
3
private/templates/ruby-mode/@@
Normal file
3
private/templates/ruby-mode/@@
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
$0
|
0
private/templates/ruby-mode/@@.gemspec
Normal file
0
private/templates/ruby-mode/@@.gemspec
Normal file
3
private/templates/ruby-mode/@@Gemfile
Normal file
3
private/templates/ruby-mode/@@Gemfile
Normal file
|
@ -0,0 +1,3 @@
|
|||
source 'https://rubygems.org'
|
||||
|
||||
$0
|
16
private/templates/ruby-mode/@@Rakefile
Normal file
16
private/templates/ruby-mode/@@Rakefile
Normal file
|
@ -0,0 +1,16 @@
|
|||
require 'bundler/setup'
|
||||
$:.unshift File.expand_path('../lib', __FILE__)
|
||||
|
||||
# rake spec
|
||||
require 'rspec/core/rake_task'
|
||||
RSpec::Core::RakeTask.new(:spec) { |t| t.verbose = false }
|
||||
|
||||
# rake console
|
||||
task :console do
|
||||
require 'pry'
|
||||
require '${1:gem_name}'
|
||||
ARGV.clear
|
||||
Pry.start
|
||||
end
|
||||
|
||||
$0
|
12
private/templates/ruby-mode/@@module
Normal file
12
private/templates/ruby-mode/@@module
Normal file
|
@ -0,0 +1,12 @@
|
|||
# `(progn
|
||||
(setq-local pkgs (s-split "/" (s-chop-prefix (concat (my/project-root) "lib/") (f-no-ext buffer-file-name)) t))
|
||||
(setq-local pkgs-p (eq (length pkgs) 1))
|
||||
(setq-local pkg-module (s-replace " " "::" (s-titleized-words (if pkgs-p (-first-item pkgs) (s-join " " (-butlast pkgs))))))
|
||||
|
||||
(concat "lib/" (f-filename buffer-file-name)))`
|
||||
|
||||
module `pkg-module`
|
||||
`(when pkgs-p " VERSION='0.0.1'\n\n")``(concat " class " (if pkgs-p "<< self" (s-capitalize (-last-item pkgs))))`
|
||||
`%`${0:# Code here}
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue