coderunner 0.13.31 → 0.13.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3704a56cf01bd088ec37e1454bbb40a953951a97
4
- data.tar.gz: 5c278045b9c3c3b8ce116fd6ee1c062282866688
3
+ metadata.gz: 1be47bdc136d03d6d96fc4144a49e887fb259ea7
4
+ data.tar.gz: e2656cecd7e642e104d5f43e106619b35ea90d71
5
5
  SHA512:
6
- metadata.gz: 769d6a88ced2e9dc14db9458c49390361a142471bb08b3666a57b73e47dbdbea2d54c053b89f4eae210d8bdbcf2cb6d1b0866ee457bb61ed90e884c03cd77c7a
7
- data.tar.gz: 3375a98e56a18d48b5ee9e54d97ebfc0b5b7af03859a7947d96e5681a0f7abb10a9d7cbe92b077a5938ee1f5eb4f4756bf844050da34bb936715355a3b7c77f8
6
+ metadata.gz: 50a9728e726cfa5f58b11f688abdf6bfb4bbc62c6ad482ce8bd63169965349a1915235c2d050ba9757b4a923ca6c0ed5c39ccf391e90316145b7df0e978e8c04
7
+ data.tar.gz: 504b22920667f66766322e3a3cc8777ed91a28ac5ffca082e5c8d98ddbdb53eec0ee42eb7156749f7c0563be20bde87b628f3fbe8ac98d6277715e877e26d8d0
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.13.31
1
+ 0.13.32
@@ -2,12 +2,12 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: coderunner 0.13.31 ruby lib
5
+ # stub: coderunner 0.13.32 ruby lib
6
6
  # stub: ext/extconf.rb
7
7
 
8
8
  Gem::Specification.new do |s|
9
9
  s.name = "coderunner"
10
- s.version = "0.13.31"
10
+ s.version = "0.13.32"
11
11
 
12
12
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
13
13
  s.require_paths = ["lib"]
@@ -755,9 +755,23 @@ def self.update_folder_defaults #updates the defaults file in the current folder
755
755
 
756
756
  end
757
757
 
758
+ # Makes a new defaults file from the given input file, copies it to the user defaults location and then sets the folder up to use it
759
+ def self.use_new_defaults_file(name=ARGV[-2], input_file=ARGV[-1])
760
+ raise "Please specify a name and an input file" if name == "use_new_defaults_file"
761
+ defaults_filename = "#{name}_defaults.rb"
762
+ central_defaults_filename = rcp.user_defaults_location + "/" + defaults_filename
763
+ raise "Defaults file: #{central_defaults_filename} already exists" if FileTest.exist? central_defaults_filename
764
+ make_new_defaults_file(name, input_file)
765
+ FileUtils.mv(defaults_filename, central_defaults_filename)
766
+ #modlet = rcp.modlet? ? rcp.modlet : nil
767
+ #executable = rcp.executable? ? rcp.executable : CodeRunner::DEFAULT_RUNNER_OPTIONS
768
+ CodeRunner.fetch_runner(D: name) #(C: rcp.code, m: rcp.modlet, D: name, CodeRunner)
769
+ end
770
+
758
771
  # The name is self-explanatory: this method takes an input file and generates a CodeRunner defaults file. The first argument is the name of the new defaults file.
759
772
 
760
773
  def self.make_new_defaults_file(name=ARGV[-2], input_file=ARGV[-1])
774
+ raise "Please specify a name and an input file" if name == "make_new_defaults_file"
761
775
  string = defaults_file_text_from_input_file(input_file)
762
776
  defaults_filename = "#{name}_defaults.rb"
763
777
  raise "This defaults name already exists" if FileTest.exist? defaults_filename
@@ -267,7 +267,7 @@ class CodeRunner
267
267
  end
268
268
  end
269
269
 
270
- raise "No default information exists for this folder. If you are running CodeRunner from the commmand line please run again with the -C <code> and -X <executable> (and -m <modlet>, if required) flag (you only need to specify these flags once in each folder). Else, please specify :code and :executable (and :modlet if required) as options in CodeRunner.new(folder, options)" unless @code and @executable
270
+ raise "No default information exists for this folder. If you are running CodeRunner from the commmand line please run again with the -C <code> (and -m <modlet>, if required) flag (you only need to specify these flags once in each folder). Else, please specify :code (and :modlet if required) as options in CodeRunner.new(folder, options)" unless @code
271
271
  end
272
272
 
273
273
  # Here we redefine the inspect function p to raise an error if anything is written to standard out
@@ -991,7 +991,9 @@ def executable_name
991
991
  end
992
992
 
993
993
  def executable_location
994
- File.dirname(@executable||=@runner.executable)
994
+ @executable||=@runner.executable
995
+ raise "No executable" unless @executable
996
+ File.dirname(@executable)
995
997
  end
996
998
 
997
999
  def update_in_queue
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coderunner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.31
4
+ version: 0.13.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edmund Highcock