diff --git a/F2C/.travis.yml b/F2C/.travis.yml new file mode 100644 index 0000000..2de5677 --- /dev/null +++ b/F2C/.travis.yml @@ -0,0 +1,10 @@ +language: ruby +rvm: +# - "1.8.7" + - "1.9.2" + - "1.9.3" +# - jruby-18mode # JRuby in 1.8 mode + - jruby-19mode # JRuby in 1.9 mode +# - rbx +# uncomment this line if your project needs to run something other than `rake`: +script: rspec F2C.spec.rb diff --git a/F2C/.yardoc/checksums b/F2C/.yardoc/checksums new file mode 100755 index 0000000..83e469f --- /dev/null +++ b/F2C/.yardoc/checksums @@ -0,0 +1 @@ +lib/F2C.rb be93e400bb67a1f65b7d61c9eeb5f60fbfdda0cb diff --git a/F2C/.yardoc/object_types b/F2C/.yardoc/object_types new file mode 100755 index 0000000..4b8d563 Binary files /dev/null and b/F2C/.yardoc/object_types differ diff --git a/F2C/.yardoc/objects/root.dat b/F2C/.yardoc/objects/root.dat new file mode 100755 index 0000000..bb286ad Binary files /dev/null and b/F2C/.yardoc/objects/root.dat differ diff --git a/F2C/.yardoc/proxy_types b/F2C/.yardoc/proxy_types new file mode 100755 index 0000000..beefda1 Binary files /dev/null and b/F2C/.yardoc/proxy_types differ diff --git a/F2C/F2C-0.0.0.gem b/F2C/F2C-0.0.0.gem new file mode 100755 index 0000000..ffeafb2 Binary files /dev/null and b/F2C/F2C-0.0.0.gem differ diff --git a/F2C/F2C-0.0.1.gem b/F2C/F2C-0.0.1.gem new file mode 100755 index 0000000..161df2c Binary files /dev/null and b/F2C/F2C-0.0.1.gem differ diff --git a/F2C/F2C-0.0.2.gem b/F2C/F2C-0.0.2.gem new file mode 100755 index 0000000..68ca82f Binary files /dev/null and b/F2C/F2C-0.0.2.gem differ diff --git a/F2C/F2C-0.0.3.gem b/F2C/F2C-0.0.3.gem new file mode 100755 index 0000000..e432145 Binary files /dev/null and b/F2C/F2C-0.0.3.gem differ diff --git a/F2C/F2C.gemspec b/F2C/F2C.gemspec new file mode 100755 index 0000000..9fdd0fa --- /dev/null +++ b/F2C/F2C.gemspec @@ -0,0 +1,12 @@ +Gem::Specification.new do |s| + s.name = "F2C" + s.version = '0.0.3' + s.date = '2014-11-23' + s.authors = ["Kenny Lu"] + s.email = ["lukenny@gmail.com"] + s.description = "Ruby class project - F2C is a simple tool that converts Fahrenheit to Celsius and vice versa" + s.summary = "Ruby class project - Fahrenheit to Celsius conversion and vice versa" + s.homepage = 'http://rubygems.org/gems/F2C' + s.licenses = 'MIT' + s.files = ["lib/F2C.rb"] +end diff --git a/F2C/F2C.spec.rb b/F2C/F2C.spec.rb new file mode 100755 index 0000000..2413476 --- /dev/null +++ b/F2C/F2C.spec.rb @@ -0,0 +1,18 @@ +# spec file to test the math of the temperature conversion + +require 'F2C.rb' + +describe Convert do + + it "Fahrenheit to Celsius" do + x = Convert.F2C(83) + #expect(x).to eq "83 Fahrenheit is 28 Celsius" + x.should eq "83 Fahrenheit is 28 Celsius" + end + + it "Celsius to Fahrenheit" do + x = Convert.C2F(18) + x.should eq "18 Celsius is 64 Fahrenheit" + end + +end diff --git a/F2C/Gemfile b/F2C/Gemfile new file mode 100644 index 0000000..49a0cbf --- /dev/null +++ b/F2C/Gemfile @@ -0,0 +1,6 @@ +source "https://rubygems.org" + +gem "bundler" , "~> 1.7.4" +gemspec +gem "rspec" , "~> 2.8.0" +gem "rake" , "~> 0.9.2.2" #included if using rake diff --git a/F2C/README.md b/F2C/README.md new file mode 100644 index 0000000..e1dec79 --- /dev/null +++ b/F2C/README.md @@ -0,0 +1,35 @@ +F2C +============= + +[![Build Status](https://travis-ci.org/influxdb/influxdb-ruby.png?branch=master)](https://travis-ci.org/lukenny/F2C) + +Summary +------- +``` +F2C converts Fahrenheit to Celsius and vice versa +Fahrenheit to Celsius formulas http://www.manuelsweb.com/temp.htm +``` + +Installation +------------ +``` +$ [sudo] gem install F2C +``` + +Usage +----- +``` +launch irb +require 'F2C' +Convert.F2C(value) #converts Fahrenheit to Celsius +Convert.C2F(value) #converts Celsius to Fahrenheit +``` +Output +------ +``` +$ irb +irb(main):001:0> require "F2C" +=> true +irb(main):002:0> Convert.F2C 100 +=> "100 Fahrenheit is 38 Celsius" +``` diff --git a/F2C/doc/Convert.html b/F2C/doc/Convert.html new file mode 100755 index 0000000..826b849 --- /dev/null +++ b/F2C/doc/Convert.html @@ -0,0 +1,251 @@ + + + + + + Module: Convert + + — Documentation by YARD 0.8.7.6 + + + + + + + + + + + + + + + + + + + + + +

Module: Convert + + + +

+ +
+ + + + + + + + +
Defined in:
+
lib/F2C.rb
+ +
+
+ + + + + + + + + +

+ Class Method Summary + (collapse) +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + + (Object) C2F(value) + + + + + +

+ + + + +
+
+
+
+18
+19
+20
+21
+
+
# File 'lib/F2C.rb', line 18
+
+def self.C2F value
+	converted_value = ((value * 9.0/5.0) + 32).round
+	return "#{value} Celsius is #{converted_value} Fahrenheit"
+end
+
+
+ +
+

+ + + (Object) F2C(value) + + + + + +

+
+ +

Overveiw F2C converts Fahrenheit to Celsius and vice versa Fahrenheit to +Celsius formulas www.manuelsweb.com/temp.htm

+ +

How to use it gem install F2C launch irb require 'F2C' +Convert.F2C(value) - “converts Fahrenheit to Celsius” Convert.C2F(value) - +“converts Celsius to Fahrenheit”

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+
+
# File 'lib/F2C.rb', line 13
+
+def self.F2C value
+  converted_value = ((value - 32) * 5.0/9.0).round
+	return "#{value} Fahrenheit is #{converted_value} Celsius"
+end
+
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/F2C/doc/_index.html b/F2C/doc/_index.html new file mode 100755 index 0000000..8b09903 --- /dev/null +++ b/F2C/doc/_index.html @@ -0,0 +1,101 @@ + + + + + + Documentation by YARD 0.8.7.6 + + + + + + + + + + + + + + + + + + + + + +

Documentation by YARD 0.8.7.6

+
+

Alphabetic Index

+ +
+

Namespace Listing A-Z

+ + + + + + + + +
+ + + + +
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/F2C/doc/class_list.html b/F2C/doc/class_list.html new file mode 100755 index 0000000..d99e51f --- /dev/null +++ b/F2C/doc/class_list.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + Class List + + + + +
+

Class List

+ + + + +
+ + diff --git a/F2C/doc/css/common.css b/F2C/doc/css/common.css new file mode 100755 index 0000000..cf25c45 --- /dev/null +++ b/F2C/doc/css/common.css @@ -0,0 +1 @@ +/* Override this file with custom rules */ \ No newline at end of file diff --git a/F2C/doc/css/full_list.css b/F2C/doc/css/full_list.css new file mode 100755 index 0000000..c918cf1 --- /dev/null +++ b/F2C/doc/css/full_list.css @@ -0,0 +1,57 @@ +body { + margin: 0; + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-size: 13px; + height: 101%; + overflow-x: hidden; +} + +h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; } +.clear { clear: both; } +#search { position: absolute; right: 5px; top: 9px; padding-left: 24px; } +#content.insearch #search, #content.insearch #noresults { background: url(data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAAPr6+pKSkoiIiO7u7sjIyNjY2J6engAAAI6OjsbGxjIyMlJSUuzs7KamppSUlPLy8oKCghwcHLKysqSkpJqamvT09Pj4+KioqM7OzkRERAwMDGBgYN7e3ujo6Ly8vCoqKjY2NkZGRtTU1MTExDw8PE5OTj4+PkhISNDQ0MrKylpaWrS0tOrq6nBwcKysrLi4uLq6ul5eXlxcXGJiYoaGhuDg4H5+fvz8/KKiohgYGCwsLFZWVgQEBFBQUMzMzDg4OFhYWBoaGvDw8NbW1pycnOLi4ubm5kBAQKqqqiQkJCAgIK6urnJyckpKSjQ0NGpqatLS0sDAwCYmJnx8fEJCQlRUVAoKCggICLCwsOTk5ExMTPb29ra2tmZmZmhoaNzc3KCgoBISEiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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FhoEAIfkECQgAAAAsAAAAABAAEAAAB2eAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4ueICImip6CIQkJKJ4kigynKaqKCyMnKqSEK05StgAGQRxPYZaENqccFgIID4KXmQBhXFkzDgOnFYLNgltaSAAEpxa7BQoQF4aBACH5BAkIAAAALAAAAAAQABAAAAdogACCg4SFggJiPUqCJSWGgkZjCUwZACQkgxGEXAmdT4UYGZqCGWQ+IjKGGIUwPzGPhAc0NTewhDOdL7Ykji+dOLuOLhI2BbaFETICx4MlQitdqoUsCQ2vhKGjglNfU0SWmILaj43M5oEAOwAAAAAAAAAAAA==) no-repeat center left; } +#full_list { padding: 0; list-style: none; margin-left: 0; } +#full_list ul { padding: 0; } +#full_list li { padding: 5px; padding-left: 12px; margin: 0; font-size: 1.1em; list-style: none; } +#noresults { padding: 7px 12px; } +#content.insearch #noresults { margin-left: 7px; } +ul.collapsed ul, ul.collapsed li { display: none; } +ul.collapsed.search_uncollapsed { display: block; } +ul.collapsed.search_uncollapsed li { display: list-item; } +li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; } +li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; } +li { color: #888; cursor: pointer; } +li.deprecated { text-decoration: line-through; font-style: italic; } +li.r1 { background: #f0f0f0; } +li.r2 { background: #fafafa; } +li:hover { background: #ddd; } +li small:before { content: "("; } +li small:after { content: ")"; } +li small.search_info { display: none; } +a:link, a:visited { text-decoration: none; color: #05a; } +li.clicked { background: #05a; color: #ccc; } +li.clicked a:link, li.clicked a:visited { color: #eee; } +li.clicked a.toggle { opacity: 0.5; background-position: bottom right; } +li.collapsed.clicked a.toggle { background-position: top right; } +#search input { border: 1px solid #bbb; -moz-border-radius: 3px; -webkit-border-radius: 3px; } +#nav { margin-left: 10px; font-size: 0.9em; display: none; color: #aaa; } +#nav a:link, #nav a:visited { color: #358; } +#nav a:hover { background: transparent; color: #5af; } +.frames #nav span:after { content: ' | '; } +.frames #nav span:last-child:after { content: ''; } + +.frames #content h1 { margin-top: 0; } +.frames li { white-space: nowrap; cursor: normal; } +.frames li small { display: block; font-size: 0.8em; } +.frames li small:before { content: ""; } +.frames li small:after { content: ""; } +.frames li small.search_info { display: none; } +.frames #search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; padding-left: 0; padding-right: 24px; } +.frames #content.insearch #search { background-position: center right; } +.frames #search input { width: 110px; } +.frames #nav { display: block; } + +#full_list.insearch li { display: none; } +#full_list.insearch li.found { display: list-item; padding-left: 10px; } +#full_list.insearch li a.toggle { display: none; } +#full_list.insearch li small.search_info { display: block; } diff --git a/F2C/doc/css/style.css b/F2C/doc/css/style.css new file mode 100755 index 0000000..96307c5 --- /dev/null +++ b/F2C/doc/css/style.css @@ -0,0 +1,339 @@ +body { + padding: 0 20px; + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-size: 13px; +} +body.frames { padding: 0 5px; } +h1 { font-size: 25px; margin: 1em 0 0.5em; padding-top: 4px; border-top: 1px dotted #d5d5d5; } +h1.noborder { border-top: 0px; margin-top: 0; padding-top: 4px; } +h1.title { margin-bottom: 10px; } +h1.alphaindex { margin-top: 0; font-size: 22px; } +h2 { + padding: 0; + padding-bottom: 3px; + border-bottom: 1px #aaa solid; + font-size: 1.4em; + margin: 1.8em 0 0.5em; +} +h2 small { font-weight: normal; font-size: 0.7em; display: block; float: right; } +.clear { clear: both; } +.inline { display: inline; } +.inline p:first-child { display: inline; } +.docstring h1, .docstring h2, .docstring h3, .docstring h4 { padding: 0; border: 0; border-bottom: 1px dotted #bbb; } +.docstring h1 { font-size: 1.2em; } +.docstring h2 { font-size: 1.1em; } +.docstring h3, .docstring h4 { font-size: 1em; border-bottom: 0; padding-top: 10px; } +.summary_desc .object_link, .docstring .object_link { font-family: monospace; } +.rdoc-term { padding-right: 25px; font-weight: bold; } +.rdoc-list p { margin: 0; padding: 0; margin-bottom: 4px; } + +/* style for */ +#filecontents table, .docstring table { border-collapse: collapse; } +#filecontents table th, #filecontents table td, +.docstring table th, .docstring table td { border: 1px solid #ccc; padding: 8px; padding-right: 17px; } +#filecontents table tr:nth-child(odd), +.docstring table tr:nth-child(odd) { background: #eee; } +#filecontents table tr:nth-child(even), +.docstring table tr:nth-child(even) { background: #fff; } +#filecontents table th, .docstring table th { background: #fff; } + +/* style for
+ + + +
+ + + + +
+ + + + + + + + + \ No newline at end of file diff --git a/F2C/doc/js/app.js b/F2C/doc/js/app.js new file mode 100755 index 0000000..d933ebc --- /dev/null +++ b/F2C/doc/js/app.js @@ -0,0 +1,219 @@ +function createSourceLinks() { + $('.method_details_list .source_code'). + before("[View source]"); + $('.toggleSource').toggle(function() { + $(this).parent().nextAll('.source_code').slideDown(100); + $(this).text("Hide source"); + }, + function() { + $(this).parent().nextAll('.source_code').slideUp(100); + $(this).text("View source"); + }); +} + +function createDefineLinks() { + var tHeight = 0; + $('.defines').after(" more..."); + $('.toggleDefines').toggle(function() { + tHeight = $(this).parent().prev().height(); + $(this).prev().show(); + $(this).parent().prev().height($(this).parent().height()); + $(this).text("(less)"); + }, + function() { + $(this).prev().hide(); + $(this).parent().prev().height(tHeight); + $(this).text("more..."); + }); +} + +function createFullTreeLinks() { + var tHeight = 0; + $('.inheritanceTree').toggle(function() { + tHeight = $(this).parent().prev().height(); + $(this).parent().toggleClass('showAll'); + $(this).text("(hide)"); + $(this).parent().prev().height($(this).parent().height()); + }, + function() { + $(this).parent().toggleClass('showAll'); + $(this).parent().prev().height(tHeight); + $(this).text("show all"); + }); +} + +function fixBoxInfoHeights() { + $('dl.box dd.r1, dl.box dd.r2').each(function() { + $(this).prev().height($(this).height()); + }); +} + +function searchFrameLinks() { + $('.full_list_link').click(function() { + toggleSearchFrame(this, $(this).attr('href')); + return false; + }); +} + +function toggleSearchFrame(id, link) { + var frame = $('#search_frame'); + $('#search a').removeClass('active').addClass('inactive'); + if (frame.attr('src') == link && frame.css('display') != "none") { + frame.slideUp(100); + $('#search a').removeClass('active inactive'); + } + else { + $(id).addClass('active').removeClass('inactive'); + frame.attr('src', link).slideDown(100); + } +} + +function linkSummaries() { + $('.summary_signature').click(function() { + document.location = $(this).find('a').attr('href'); + }); +} + +function framesInit() { + if (hasFrames) { + document.body.className = 'frames'; + $('#menu .noframes a').attr('href', document.location); + try { + window.top.document.title = $('html head title').text(); + } catch(error) { + // some browsers will not allow this when serving from file:// + // but we don't want to stop the world. + } + } + else { + $('#menu .noframes a').text('frames').attr('href', framesUrl); + } +} + +function keyboardShortcuts() { + if (window.top.frames.main) return; + $(document).keypress(function(evt) { + if (evt.altKey || evt.ctrlKey || evt.metaKey || evt.shiftKey) return; + if (typeof evt.target !== "undefined" && + (evt.target.nodeName == "INPUT" || + evt.target.nodeName == "TEXTAREA")) return; + switch (evt.charCode) { + case 67: case 99: $('#class_list_link').click(); break; // 'c' + case 77: case 109: $('#method_list_link').click(); break; // 'm' + case 70: case 102: $('#file_list_link').click(); break; // 'f' + default: break; + } + }); +} + +function summaryToggle() { + $('.summary_toggle').click(function() { + if (localStorage) { + localStorage.summaryCollapsed = $(this).text(); + } + $('.summary_toggle').each(function() { + $(this).text($(this).text() == "collapse" ? "expand" : "collapse"); + var next = $(this).parent().parent().nextAll('ul.summary').first(); + if (next.hasClass('compact')) { + next.toggle(); + next.nextAll('ul.summary').first().toggle(); + } + else if (next.hasClass('summary')) { + var list = $('