Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
33 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,8 +1,8 @@ | |||
class ChordProPDF < ChordProFile | class ChordProPDF < ChordProFile | ||
extension "pdf" | extension "pdf" | ||
|
|
||
processor do |chordpro, pdf| | processor do |doc, pdf| | ||
ps = ChordProPS.new(chordpro) | ps = ChordProPS.new(doc) | ||
system("ps2pdf #{ps.path} #{pdf.path}") | system("ps2pdf #{ps.path} #{pdf.path}") | ||
end | end | ||
end | end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,8 +1,8 @@ | |||
class ChordProPS < ChordProFile | class ChordProPS < ChordProFile | ||
extension "ps" | extension "ps" | ||
|
|
||
processor do |chordpro, ps| | processor do |doc, ps| | ||
txt = ChordProTXT.new(chordpro) | txt = ChordProTXT.new(doc) | ||
system("chordii -o #{ps.path} #{txt.path}") | system("chordii -o #{ps.path} #{txt.path}") | ||
end | end | ||
end | end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,8 +1,8 @@ | |||
class ChordProTXT < ChordProFile | class ChordProTXT < ChordProFile | ||
extension "txt" | extension "txt" | ||
|
|
||
processor do |chordpro, txt| | processor do |doc, txt| | ||
txt.write(chordpro.markup) | txt.write(doc.markup) | ||
txt.close | txt.close | ||
end | end | ||
end | end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,6 +1,15 @@ | |||
require "rest_client" | |||
|
|||
class Doc < ActiveRecord::Base | class Doc < ActiveRecord::Base | ||
belongs_to :user | belongs_to :user | ||
|
|
||
validates_presence_of :user_id, :name | validates_presence_of :user_id, :name | ||
validates_uniqueness_of :name, scope: :user_id | validates_uniqueness_of :name, scope: :user_id | ||
|
|||
def render | |||
RestClient.post( | |||
"http://tenbyten.com/cgi-bin/webchord.pl", | |||
chordpro: markup | |||
) | |||
end | |||
end | end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters