100+ results for 'gsub'
Not the results you expected?
BinaryNullableSubtractTests.cs (https://gitlab.com/0072016/0072016-corefx-) C# · 330 lines
92 [Theory, ClassData(typeof(CompilationTypes))]
93 public static void CheckNullableULongSubtractTest(bool useInterpreter)
94 {
95 ulong?[] array = new ulong?[] { 0, 1, ulong.MaxValue };
98 for (int j = 0; j < array.Length; j++)
99 {
100 VerifyNullableULongSubtract(array[i], array[j], useInterpreter);
101 }
102 }
105 [Theory, ClassData(typeof(CompilationTypes))]
106 public static void CheckNullableLongSubtractTest(bool useInterpreter)
107 {
108 long?[] array = new long?[] { 0, 1, -1, long.MinValue, long.MaxValue };
generator.rb (https://github.com/realityforge/gwt-contacts.git) Ruby · 209 lines
26 :repository,
27 "#{Domgen::Generator::Imit::TEMPLATE_DIRECTORY}/graph_enum.java.erb",
28 'main/java/#{repository.imit.qualified_graph_enum_name.gsub(".","/")}.java',
29 Domgen::Generator::Imit::HELPERS)
30 end
34 :entity,
35 "#{Domgen::Generator::Imit::TEMPLATE_DIRECTORY}/entity.java.erb",
36 'main/java/#{entity.imit.qualified_name.gsub(".","/")}.java',
37 Domgen::Generator::Imit::HELPERS)
38 template_set.template(Domgen::Generator::Imit::FACETS,
39 :data_module,
40 "#{Domgen::Generator::Imit::TEMPLATE_DIRECTORY}/mapper.java.erb",
41 'main/java/#{data_module.imit.qualified_mapper_name.gsub(".","/")}.java',
42 Domgen::Generator::Imit::HELPERS)
43 template_set.template(Domgen::Generator::Imit::FACETS,
Enumerator2.rb (https://github.com/MagLev/maglev.git) Ruby · 689 lines
598 end # ]
600 class StringGsubEnumerator < Enumerator #
601 def initialize(obj, enum_sel, regex)
602 super(obj, enum_sel)
684 StringEachEnumerator = Enumerable::StringEachEnumerator
685 ArrayEnumerator = Enumerable::ArrayEnumerator
686 StringGsubEnumerator = Enumerable::StringGsubEnumerator
687 end
688 String.__freeze_constants
Enable-AzFrontDoorCustomDomainHttps.md (https://github.com/Azure/azure-powershell.git) Markdown · 367 lines
70 Backends :
71 CustomHttpsProvisioningState : Enabling
72 CustomHttpsProvisioningSubstate : SubmittingDomainControlValidationRequest
73 CertificateSource : FrontDoor
74 ProtocolType : ServerNameIndication
99 Backends :
100 CustomHttpsProvisioningState : Enabling
101 CustomHttpsProvisioningSubstate : SubmittingDomainControlValidationRequest
102 CertificateSource : AzureKeyVault
103 ProtocolType : ServerNameIndication
127 Backends :
128 CustomHttpsProvisioningState : Enabling
129 CustomHttpsProvisioningSubstate : SubmittingDomainControlValidationRequest
130 CertificateSource : FrontDoor
131 ProtocolType : ServerNameIndication
language.rb (https://github.com/grosser/language_sniffer.git) Ruby · 345 lines
snippets_controller_spec.rb (https://gitlab.com/klml/gitlab-ee) Ruby · 325 lines
validate_numericality_of_matcher.rb (https://github.com/BillTheBest/sms.git) Ruby · 214 lines
ocaml.rb (https://github.com/nakao/langscan.git) Ruby · 298 lines
properties.spform.php (https://github.com/BobRay/SPForm.git) PHP · 661 lines
forums.lua (http://facepunch-lua-sdk.googlecode.com/svn/trunk/) Lua · 261 lines
168 retForum.forumID = tonumber( forumID )
170 -- need to specify base, otherwise it takes the second return value for gsub
171 retForum.threadCount = tonumber( string.gsub( threadCount, ",", "" ), 10 )
172 retForum.postCount = tonumber( string.gsub( postCount, ",", "" ), 10 )
174 retForum.forumName = forumName
175 retForum.viewers = tonumber( string.gsub( viewers, ",", "" ), 10 )
176 retForum.forumDescription = forumDescription
177 retForum.lastPosterID = tonumber( lastPosterID )
252 thread.lastPosterName = lastPosterName
253 thread.lastPostURL = lastPostURL
254 thread.replyCount = tonumber( string.gsub( replies, ",", "" ), 10 )
255 thread.viewCount = tonumber( string.gsub( views, ",", "" ), 10 )
content_query_spec.rb (https://github.com/kstephens/contenter.git) Ruby · 568 lines
ModelsTest.java (https://github.com/seratch/jslack.git) Java · 250 lines
7 import com.slack.api.model.block.composition.*;
8 import com.slack.api.model.block.element.*;
9 import com.slack.api.model.dialog.DialogSubType;
10 import com.slack.api.model.event.MessageBotEvent;
11 import com.slack.api.model.event.MessageEvent;
29 @Test
30 public void dialogSubTypes() {
31 assertEquals("number", DialogSubType.NUMBER.value());
blocks_controller.rb (https://github.com/billyswifty/caboose-cms.git) Ruby · 396 lines
url.lua (https://github.com/linxiangyu/QSanguosha.git) Lua · 297 lines
27 -----------------------------------------------------------------------------
28 function escape(s)
29 return string.gsub(s, "([^A-Za-z0-9_])", function(c)
30 return string.format("%%%02x", string.byte(c))
31 end)
57 local function protect_segment(s)
58 return string.gsub(s, "([^A-Za-z0-9_])", function (c)
59 if segment_set[c] then return c
60 else return string.format("%%%02x", string.byte(c)) end
70 -----------------------------------------------------------------------------
71 function unescape(s)
72 return string.gsub(s, "%%(%x%x)", function(hex)
73 return string.char(base.tonumber(hex, 16))
74 end)
sqlsrv.php (https://gitlab.com/wendy-du-973/club-invest-gr2) PHP · 429 lines
144 *
145 * @param string $setting The name of the setting to set. The possible values are
146 * "WarningsReturnAsErrors", "LogSubsystems", and "LogSeverity".
147 * @param mixed $value The value of the specified setting. The following table shows possible values:
148 *
161 *
162 *
163 * LogSubsystems
164 * SQLSRV_LOG_SYSTEM_ALL (-1)
165 * SQLSRV_LOG_SYSTEM_CONN (2)
cgit.css (https://github.com/lohner/cgit.git) CSS · 812 lines
association_matcher.rb (https://github.com/cavneb/remarkable.git) Ruby · 283 lines
package-frame.html (https://github.com/ianw/bottomupcs.git) HTML · 148 lines
67 <A HREF="GlyphPositioningState.html" title="class in org.apache.fop.complexscripts.fonts" target="classFrame">GlyphPositioningState</A>
68 <BR>
69 <A HREF="GlyphPositioningSubtable.html" title="class in org.apache.fop.complexscripts.fonts" target="classFrame">GlyphPositioningSubtable</A>
70 <BR>
71 <A HREF="GlyphPositioningTable.html" title="class in org.apache.fop.complexscripts.fonts" target="classFrame">GlyphPositioningTable</A>
request.lua (https://github.com/zq2599/blog_demos.git) Lua · 351 lines
liberty-idsis-pp-v1.1.xsd (https://github.com/jgallimore/axis-with-mods.git) XML Schema · 260 lines
200 <xs:element ref="MsgProvider" minOccurs="0"/>
201 <xs:element ref="MsgAccount" minOccurs="0"/>
202 <xs:element ref="MsgSubaccount" minOccurs="0"/>
203 <xs:element ref="Extension" minOccurs="0"/>
204 </xs:sequence>
218 <xs:element name="MsgProvider" type="DSTString"/>
219 <xs:element name="MsgAccount" type="DSTString"/>
220 <xs:element name="MsgSubaccount" type="DSTString"/>
221 <xs:element name="Facade" type="FacadeType"/>
222 <xs:complexType name="FacadeType">
zip.lua (https://github.com/hiili/WindowsTorch.git) Lua · 248 lines
Subtypes2Test.java (https://gitlab.com/essere.lab.public/qualitas.class-corpus) Java · 339 lines
106 }
108 public void testStringSubtypeOfObject() throws Throwable {
109 executeFindBugsTest(new RunnableWithExceptions(){
110 /* (non-Javadoc)
119 }
121 public void testStringSubtypeOfSerializable() throws Throwable {
122 executeFindBugsTest(new RunnableWithExceptions(){
123 /* (non-Javadoc)
225 }
227 public void testSpecialStringSubclasses() throws Exception {
228 executeFindBugsTest(new RunnableWithExceptions() {
229 /* (non-Javadoc)
command.rb (https://gitlab.com/adamlwalker/thor) Ruby · 133 lines
42 if namespace
43 namespace = klass.namespace
44 formatted = "#{namespace.gsub(/^(default)/, '')}:"
45 end
46 formatted = "#{klass.namespace.split(':').last} " if subcommand
50 # Add usage with required arguments
51 formatted << if klass && !klass.arguments.empty?
52 usage.to_s.gsub(/^#{name}/) do |match|
53 match << " " << klass.arguments.map { |a| a.usage }.compact.join(" ")
54 end
diff_spec.rb (https://github.com/cread/chef.git) Ruby · 328 lines
marc_document.rb (https://github.com/rsinger/The-Visible-Kilgour.git) Ruby · 316 lines
util.js (https://gitlab.com/nguyenviettuananh/my-awesome-project) JavaScript · 136 lines
45 // The result inherits any tainting in the original string or any supplied replacement string.
46 //
47 // "hello".gsub /[aeiou]/, '*' #=> "h*ll*"
48 // "hello".gsub /[aeiou]/, '<$1>' #=> "h<e>ll<o>"
49 // "hello".gsub /[aeiou]/, ($) {
50 // "<#{$[1]}>" #=> "h<e>ll<o>"
51 //
52 gsub: function (str, pattern, replacement) {
53 var i, match, matchCmpr, matchCmprPrev, replacementStr, result, self;
54 if (!((pattern != null) && (replacement != null))) return u.string.value(str);
72 for (i = 1; i <= 9; i++) {
73 if (matchCmpr[i]) {
74 replacementStr = u.string.gsub(replacementStr, new RegExp("\\\$" + i), matchCmpr[i]);
75 }
76 }
controller.lua (https://github.com/AdUki/LimLim.git) Lua · 382 lines
index.go (https://github.com/xushiwei/go.old.git) Go · 225 lines
143 var choices = [][]string{
144 // Direct value, fetch from struct, fetch from struct pointer.
145 // The last two cases get us to oindex_const_sudo in gsubr.c.
146 []string{"", "t.", "pt."},
151 // Element is int, element is quad (struct).
152 // This controls whether we end up in gsubr.c (i) or cgen.c (q).
153 []string{"i", "q"},
collection.rb (https://github.com/palladius/lovd-by-less.git) Ruby · 142 lines
test_zenweb_plugins_markdown.rb (https://github.com/seattlerb/zenweb.git) Ruby · 298 lines
scancode.rb (https://github.com/vishvananda/veewee.git) Ruby · 114 lines
sallie_mae.rb (https://github.com/pgsql/spree.git) Ruby · 144 lines
user_reference_filter.rb (https://gitlab.com/vilhelmen/gitlab-ce) Ruby · 151 lines
location.rb (https://bitbucket.org/pcmyers/active_shipping.git) Ruby · 137 lines
zonefile.rb (https://github.com/zarqman/dns-zonefile.git) Ruby · 315 lines
mapping.rb (https://github.com/hpeltola/VisualREST.git) Ruby · 128 lines
49 #Escape string to be used in JavaScript. Lifted from rails.
50 def self.escape_javascript(javascript)
51 javascript.gsub(/\r\n|\n|\r/, "\\n").gsub("\"") { |m| "\\#{m}" }
52 end
54 #Transform a ruby-type method name (like add_overlay) to a JavaScript-style one (like addOverlay).
55 def self.javascriptify_method(method_name)
56 method_name.gsub(/_(\w)/){|s| $1.upcase}
57 end
Money.lua (https://github.com/ELLIOTTCABLE/Warcrack.git) Lua · 232 lines
custom_field_steps.rb (https://gitlab.com/MichelZuniga/openproject) Ruby · 117 lines
ssl.rb (https://github.com/jlamberg/ruby.git) Ruby · 185 lines
100 if /\ADNS:(.*)/ =~ general_name
101 should_verify_common_name = false
102 reg = Regexp.escape($1).gsub(/\\\*/, "[^.]+")
103 return true if /\A#{reg}\z/i =~ hostname
104 elsif /\AIP Address:(.*)/ =~ general_name
111 cert.subject.to_a.each{|oid, value|
112 if oid == "CN"
113 reg = Regexp.escape(value).gsub(/\\\*/, "[^.]+")
114 return true if /\A#{reg}\z/i =~ hostname
115 end
AppBuilder.cs (https://gitlab.com/kush/Avalonia) C# · 112 lines
66 }
68 var renderingSubsystemAttribute = (from assembly in AppDomain.CurrentDomain.GetAssemblies()
69 from attribute in assembly.GetCustomAttributes<ExportRenderingSubsystemAttribute>()
71 where attribute.RequiresWindowingSubsystem == null
72 || attribute.RequiresWindowingSubsystem == windowingSubsystemAttribute.Name
73 orderby attribute.Priority ascending
74 select attribute).FirstOrDefault();
79 }
81 UseWindowingSubsystem(() => windowingSubsystemAttribute.InitializationType
82 .GetRuntimeMethod(windowingSubsystemAttribute.InitializationMethod, Type.EmptyTypes).Invoke(null, null),
83 windowingSubsystemAttribute.Name);
85 UseRenderingSubsystem(() => renderingSubsystemAttribute.InitializationType
86 .GetRuntimeMethod(renderingSubsystemAttribute.InitializationMethod, Type.EmptyTypes).Invoke(null, null),
register.component.html (https://github.com/juniorsatanas/SpringSecurityVraptor.git) HTML · 122 lines
cast.rb (https://github.com/Tho85/rails.git) Ruby · 168 lines
51 elsif String === string
52 Hash[string.scan(HstorePair).map { |k, v|
53 v = v.upcase == 'NULL' ? nil : v.gsub(/\A"(.*)"\Z/m,'\1').gsub(/\\(.)/, '\1')
54 k = k.gsub(/\A"(.*)"\Z/m,'\1').gsub(/\\(.)/, '\1')
138 '""'
139 else
140 '"%s"' % value.to_s.gsub(/(["\\])/, '\\\\\1')
141 end
142 end
150 value
151 else
152 value = value.gsub(/\\/, ARRAY_ESCAPE)
153 value.gsub!(/"/,"\\\"")
localization_simplified.rb (https://github.com/manishasarkar/rhodes.git) Ruby · 143 lines
11 # from RUtils plugin
12 def self.localize_strftime(date='%d.%m.%Y', time='')
13 #date.gsub!('%%', @@ignore)
14 date.gsub!('%a', LocalizationSimplified::DateHelper::AbbrDaynames[time.wday])
15 date.gsub!('%A', LocalizationSimplified::DateHelper::Daynames[time.wday])
16 date.gsub!('%b', LocalizationSimplified::DateHelper::AbbrMonthnames[time.mon])
17 date.gsub!('%B', LocalizationSimplified::DateHelper::Monthnames[time.mon])
18 #date.gsub!(@@ignore, '%%')
133 begin
134 parts = number.to_s.split('.')
135 parts[0].gsub!(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1#{delimiter}")
136 parts.join(separator)
137 rescue
ProjectSpecificFields.java (https://github.com/alminium/angelfalls.git) Java · 100 lines
luat-cod.lua (https://bitbucket.org/preining/tex-live.git) Lua · 169 lines
7 }
9 local match, gsub, find, format = string.match, string.gsub, string.find, string.format
11 local texconfig, lua = texconfig, lua
35 function lua.registercode(filename,version)
36 local barename = gsub(filename,"%.[%a%d]+$","")
37 if barename == filename then filename = filename .. ".lua" end
38 local basename = match(barename,"^.+[/\\](.-)$") or barename
80 -- no string.unquoted yet
82 local sourcefile = gsub(arg and arg[1] or "","^\"(.*)\"$","%1")
83 local sourcepath = find(sourcefile,"/") and gsub(sourcefile,"/[^/]+$","") or ""
go.rb (https://gitlab.com/mehlah/gitlab-ce) Ruby · 122 lines
0001-Revise-Makefile.patch (https://gitlab.com/jiangming1399/packages) Patch · 135 lines
luaannotate.lua (https://github.com/howardzhang/lua-annotate.git) Lua · 170 lines
16 if id then
17 --print('DEBUG-luacomment-commit', id, text)
18 text = text:gsub('[\r\n]$', '')
19 annotations[id] = text
20 end
117 -- SciTE ExtMan callback function, on file opened.
118 scite_OnOpen(function(path)
119 local annotations_path = path:gsub('[^\\/]+$', 'annotations.txt')
120 print('DEBUG-luacomment-open', path, annotations_path)
121 if exists_file(annotations_path) then
132 -- Escapes characters in text to allow embedding inside C comment (/* */).
133 local function cpp_escape_comment(text)
134 text = text:gsub('%*/', '* /')
135 return text
136 end
CopyResources.lua (https://github.com/chrishaukap/GameDev.git) Lua · 143 lines
45 require "pl"
47 lfs.chdir(fulljoin(os.getenv('PROJECT_DIR'), '..', 'Angel', 'Scripting', 'EngineScripts'):gsub('"', ''))
49 function building_for_iphone()
80 end
82 if (not path.exists(dest:gsub('"', ''))) then
83 makedirs(dest:gsub('"', ''))
87 if (not _isdotfile(filename)) then
88 local dstname = fulljoin(dest, path.basename(filename))
89 dir.copyfile(filename, dstname:gsub('"', ''))
90 end
91 end
node.rb (https://github.com/akiko74/sakanakana.git) Ruby · 183 lines
Makefile (https://gitlab.com/unofficial-mirrors/openshift-source-to-image) Makefile · 142 lines
quote-purchase-order.component.html (https://bitbucket.org/inderjitsi/test-mean-app.git) HTML · 159 lines
6 <p>Hi {{ purchaseOrder?.purchase_order_id?.vendorObject[0].name }}, you have been requested by <b>{{ purchaseOrder?.company_id?.companyName }}</b> to quote your price for the below purchase order.</p>
7 </div>
8 <form [formGroup]="poForm" (ngSubmit)="onSubmit()" class="" novalidate>
9 <div class="wrapper wrapper-content animated fadeInRight">
10 <div class="row form-group">
vcard_test.rb (https://github.com/mweibel/vines.git) Ruby · 141 lines
references.rb (https://github.com/peter-murach/github.git) Ruby · 150 lines
index2.html (https://github.com/jataggart/keg-server.git) HTML · 128 lines
known_hosts.rb (https://github.com/tecknicaltom/metasploit-framework.git) Ruby · 132 lines
system.rb (https://github.com/betoatx/metasploit-framework.git) Ruby · 153 lines
18 kernel_version = cmd_exec("uname -a")
19 if kernel_version =~ /Ubuntu/
20 version = read_file("/etc/issue").gsub(/\n|\\n|\\l/,'')
21 system_data[:distro] = "ubuntu"
22 system_data[:version] = version
23 system_data[:kernel] = kernel_version
24 else
25 version = read_file("/etc/issue").gsub(/\n|\\n|\\l/,'')
26 system_data[:distro] = "debian"
27 system_data[:version] = version
32 elsif etc_files.include?("system-release")
33 kernel_version = cmd_exec("uname -a")
34 version = read_file("/etc/system-release").gsub(/\n|\\n|\\l/,'')
35 system_data[:distro] = "amazon"
36 system_data[:version] = version
diagnose.R (https://gitlab.com/kumarsiva07/shiny) R · 157 lines
rake_task.rb (https://github.com/cloudspokes/cs-website.git) Ruby · 179 lines
_filters.rhtml (https://github.com/orospakr/chiliproject-ircan.git) Ruby HTML · 121 lines
83 <td style="width:200px;">
84 <%= check_box_tag 'f[]', field, query.has_filter?(field), :onclick => "toggle_filter('#{field}');", :id => "cb_#{field}" %>
85 <label for="cb_<%= field %>"><%= filter[1][:name] || l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) %></label>
86 </td>
87 <td style="width:150px;">
112 <td class="add-filter">
113 <%= label_tag('add_filter_select', l(:label_filter_add)) %>:
114 <%= select_tag 'add_filter_select', options_for_select([["",""]] + query.available_filters.sort{|a,b| a[1][:order]<=>b[1][:order]}.collect{|field| [ field[1][:name] || l(("field_"+field[0].to_s.gsub(/_id$/, "")).to_sym), field[0]] unless query.has_filter?(field[0])}.compact),
115 :onchange => "add_filter();",
116 :class => "select-small",
patterns.lua (https://gitlab.com/potray/wowInterface) Lua · 210 lines
PubDateHeuristicDOMParsingPass1.java (https://github.com/MarginaliaSearch/MarginaliaSearch.git) Java · 148 lines
133 if (htmlStandard == HtmlStandard.UNKNOWN) {
134 PubDateParser
135 .dateFromHighestYearLookingSubstring(text)
136 .ifPresent(this::setPubDate);
137 }
138 else {
139 PubDateParser
140 .dateFromHighestYearLookingSubstringWithGuess(text, htmlStandard.yearGuess)
141 .ifPresent(this::setPubDate);
142 }
esr_recipe.rb (https://github.com/raskhadafi/vesr.git) Ruby · 149 lines
resource.rb (https://github.com/dickeyxxx/active_admin.git) Ruby · 159 lines
creator.rb (https://github.com/tychobrailleur/rawr.git) Ruby · 131 lines
tp.R (https://gitlab.com/pr2016/aed) R · 133 lines
10 # lo dejo en cero bajo la categoria NN (no number).
11 data$TicketPref <- as.factor(toupper(
12 gsub('^$', 'NP',
13 gsub('[./ ]', '',
14 gsub('^(((.+) )?[0-9]+|(.*))$', '\\3\\4', data$Ticket)))))
15 data$TicketNum <- as.numeric(gsub('^(.+ )?([^ ]+)$', '\\2', data$Ticket))
20 # ninguno de estos, la categoria por defecto es NT (no title).
21 data$Title <- as.factor(toupper(
22 gsub('^$', 'NT',
23 gsub('^(.*(Mr|Mrs|Miss)\\..*|.*)$', '\\2', data$Name))))
28 # Embarked es un factor con cuatro valors: C, Q, S y ''. En el caso vacio,
29 # asigno la categoria NP (no port).
30 data$Embarked <- as.factor(gsub('', 'NP', data$Embarked))
32 # El tratamiento de las cabinas es mas complejo:
css.php (https://github.com/sarriaroman/PuntoUBP.git) PHP · 238 lines
attachment_magick_test.rb (https://github.com/marcosinger/attachment_magick.git) Ruby · 133 lines
string_portuguese.rb (https://github.com/danicuki/brazilian-rails.git) Ruby · 153 lines
13 def self.nome_proprio(texto)
14 return texto if texto.blank?
15 self.titleize(texto).gsub(/ D(a|e|o|as|os) /, ' d\1 ').gsub(/ E /, ' e ')
16 end
31 # texto ==> 'Maria de Souza dos Santos e Silva da Costa'
32 def nome_proprio!
33 self.gsub!(/^.*$/, String.nome_proprio(self)) if self
34 end
40 def self.remover_acentos(texto)
41 return texto if texto.blank?
42 texto = texto.gsub(/[á|à|ã|â|ä]/, 'a').gsub(/(é|è|ê|ë)/, 'e').gsub(/(í|ì|î|ï)/, 'i').gsub(/(ó|ò|õ|ô|ö)/, 'o').gsub(/(ú|ù|û|ü)/, 'u')
43 texto = texto.gsub(/(Á|À|Ã|Â|Ä)/, 'A').gsub(/(É|È|Ê|Ë)/, 'E').gsub(/(Í|Ì|Î|Ï)/, 'I').gsub(/(Ó|Ò|Õ|Ô|Ö)/, 'O').gsub(/(Ú|Ù|Û|Ü)/, 'U')
44 texto = texto.gsub(/ñ/, 'n').gsub(/Ñ/, 'N')
45 texto = texto.gsub(/ç/, 'c').gsub(/Ç/, 'C')
html.lua (https://gitlab.com/kokeiro001/YamabiYagiNoHoko) Lua · 267 lines
33 local function search (path, name)
34 for c in string.gfind(path, "[^;]+") do
35 c = string.gsub(c, "%?", name)
36 local f = io.open(c)
37 if f then -- file exist?
52 -- search using package.path (modified to search .lp instead of .lua
53 local search_path = string.gsub(package.path, "%.lua", "")
54 local templatepath = search(search_path, templatepath)
55 assert(templatepath, string.format("template `%s' not found", template))
77 local h = html
78 from = from or ""
79 string.gsub(from, "/", function () h = "../" .. h end)
80 return h
81 end
groups_helper.rb (https://github.com/meloon/crabgrass.git) Ruby · 155 lines
reg_backend_shares.c (https://github.com/theuni/XBMC-deps.git) C · 164 lines
67 *********************************************************************/
69 static int shares_subkey_info( const char *key, struct regsubkey_ctr *subkey_ctr )
70 {
71 char *path;
84 if ( top_level ) {
85 num_subkeys = 1;
86 regsubkey_ctr_addkey( subkey_ctr, "Security" );
87 }
88 #if 0
135 *********************************************************************/
137 static bool shares_store_subkey( const char *key, struct regsubkey_ctr *subkeys )
138 {
139 return False;
DoExpressCheckoutPaymentResponseDetailsType.java (https://github.com/castelarhub/CirculoCredito.git) Java · 298 lines
25 * <element name="RedirectRequired" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
26 * <element name="Note" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
27 * <element name="MsgSubID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
28 * <element name="SuccessPageRedirectRequested" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
29 * <element name="UserSelectedOptions" type="{urn:ebay:apis:eBLBaseComponents}UserSelectedOptionType" minOccurs="0"/>
44 "redirectRequired",
45 "note",
46 "msgSubID",
47 "successPageRedirectRequested",
48 "userSelectedOptions",
61 @XmlElement(name = "Note")
62 protected String note;
63 @XmlElement(name = "MsgSubID")
64 protected String msgSubID;
197 /**
198 * Gets the value of the msgSubID property.
199 *
200 * @return
user.rb (https://github.com/galetahub/sunrise-core.git) Ruby · 158 lines
merger.rb (https://github.com/alovak/merge_db.git) Ruby · 190 lines
resource_platform_map.rb (https://github.com/jkeiser/chef.git) Ruby · 151 lines
pager.rb (https://github.com/rwaldhoff/dm-pagination.git) Ruby · 193 lines
standardfilters.rb (https://github.com/peertransfer/liquid.git) Ruby · 244 lines
68 def strip_html(input)
69 input.to_s.gsub(/<script.*?<\/script>/, '').gsub(/<.*?>/, '')
70 end
72 # Remove all newlines from the string
73 def strip_newlines(input)
74 input.to_s.gsub(/\n/, '')
75 end
106 # Replace occurrences of a string with another
107 def replace(input, string, replacement = '')
108 input.to_s.gsub(string, replacement)
109 end
CreateChildSiteInputParametersChecker.java (https://github.com/shroggle/Shroggle.git) Java · 129 lines
issues_helper_spec.rb (https://gitlab.com/artofhuman/gitlab-ce) Ruby · 188 lines
be.rb (https://bitbucket.org/tduarte/hite.in.git) Ruby · 224 lines
task.rb (https://github.com/dhedlund/mnch-hotline.git) Ruby · 173 lines
79 if patient.encounters.find_by_encounter_type(EncounterType.find_by_name(art_encounters[0]).id).blank? and task.encounter_type != art_encounters[0]
80 task.url = "/patients/summary?patient_id={patient}&skipped={encounter_type}"
81 task.url = task.url.gsub(/\{encounter_type\}/, "#{art_encounters[0].gsub(' ','_')}")
82 return task
83 elsif patient.encounters.find_by_encounter_type(EncounterType.find_by_name(art_encounters[0]).id).blank? and task.encounter_type == art_encounters[0]
92 if hiv_reception.blank? and task.encounter_type != art_encounters[1]
93 task.url = "/patients/summary?patient_id={patient}&skipped={encounter_type}"
94 task.url = task.url.gsub(/\{encounter_type\}/, "#{art_encounters[1].gsub(' ','_')}")
95 return task
96 elsif hiv_reception.blank? and task.encounter_type == art_encounters[1]
111 if vitals.blank? and task.encounter_type != art_encounters[2]
112 task.url = "/patients/summary?patient_id={patient}&skipped={encounter_type}"
113 task.url = task.url.gsub(/\{encounter_type\}/, "#{art_encounters[2].gsub(' ','_')}")
114 return task
115 elsif vitals.blank? and task.encounter_type == art_encounters[2]
asset_processor.rb (https://github.com/Jabir/Yaron-CMS.git) Ruby · 138 lines
6 def initialize(file, options = {})
7 super
8 ctype = (`file -Ib #{file.path} 2>/dev/null || file -ib #{file.path} 2>/dev/null`.gsub(/\n/,""))
9 @is_image = /image/ =~ ctype || /pdf/ =~ ctype
10 @is_video = !@is_image
103 begin
104 success = Paperclip.run("convert", command.gsub(/\s+/, " "))
105 rescue PaperclipCommandLineError
106 raise PaperclipError, "There was an error processing the thumbnail for #{@basename}" if @whiny
mike-gcc.exp (https://bitbucket.org/pizzafactory/pf-gcc.git) Expect · 260 lines
169 # remove any leftover CRs.
170 regsub -all -- "\r" $comp_output "" comp_output
172 regsub -all "(^|\n)\[^\n\]*linker input file unused since linking not done" $comp_output "" comp_output
173 regsub -all "(^|\n)\[^\n\]*file path prefix \[^\n\]* never used" $comp_output "" comp_output
175 set unsupported_message [${tool}_check_unsupported_p $comp_output]
rails_refactor.rb (https://github.com/tricon/rails_refactor.git) Ruby · 189 lines
38 to_controller_path = "app/controllers/#{@to.underscore}.rb"
39 to_resource_name = @to.gsub(/Controller$/, "")
40 to_resource_path = to_resource_name.underscore
78 def setup_for_controller_rename
79 @from_controller, @from_action = @from.split(".")
80 @from_resource_name = @from_controller.gsub(/Controller$/, "")
81 @from_resource_path = @from_resource_name.underscore
82 end
84 def replace_in_file(path, find, replace)
85 contents = File.read(path)
86 contents.gsub!(find, replace)
87 File.open(path, "w+") { |f| f.write(contents) }
88 end
test_builder.rb (https://github.com/somasekar/My_First_Application.git) Ruby · 227 lines
database_spec.rb (https://github.com/smtrox214/echo.git) Ruby · 199 lines
plugin.rb (https://gitlab.com/orvi2014/rcs-db-ext) Ruby · 274 lines
ns.go (https://github.com/paralect/mongo.git) Go · 241 lines
60 // the remaining string if there is such a variable at the beginning
61 func peelLeadingVariable(in string) (name, rest string, ok bool) {
62 var match = variableRE.FindStringSubmatch(in)
63 if len(match) != 3 {
64 return
71 func replaceWildCards(in string) string {
72 count := 1
73 match := wildCardRE.FindStringSubmatch(in)
74 for len(match) > 2 {
75 in = fmt.Sprintf("%s$%d$%s", match[1], count, match[2])
76 match = wildCardRE.FindStringSubmatch(in)
77 count++
78 }
tc_headers.rb (https://github.com/nkokkos/spot-us.git) Ruby · 277 lines
12 class TestFasterCSVHeaders < Test::Unit::TestCase
13 def setup
14 @data = <<-END_CSV.gsub(/^\s+/, "")
15 first,second,third
16 A,B,C
184 def test_converters
185 # create test data where headers and fields look alike
186 data = <<-END_MATCHING_CSV.gsub(/^\s+/, "")
187 1,2,3
188 1,2,3
243 def test_skip_blanks
244 @data = <<-END_CSV.gsub(/^ +/, "")
templator.rb (https://github.com/bairdb/shada.git) Ruby · 252 lines
eliza.rb (https://github.com/vishalmanohar/askjeeves.git) Ruby · 231 lines
ResolvedCallImpl.java (https://github.com/iamsteveholmes/kotlin.git) Java · 230 lines
filter_manager.rb (https://bitbucket.org/toihrk/fusuma.git) Ruby · 203 lines
call_by_name_spec.rb (https://github.com/stonegao/rewrite_rails.git) Ruby · 267 lines
ForceSFV.tcl (http://nxscripts.googlecode.com/svn/) TCL · 130 lines
tcl.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 458 lines
lua.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 235 lines
ResourceLoader.cpp (https://bitbucket.org/ultra_iter/qt-vtl.git) C++ · 515 lines
gu.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 1231 lines
261 <l:template name="msgrel" text="%t"/>
262 <l:template name="msgset" text="%t"/>
263 <l:template name="msgsub" text="%t"/>
264 <l:template name="note" text="%t"/>
265 <l:template name="orderedlist" text="%t"/>
403 <l:template name="msgrel" text="%t"/>
404 <l:template name="msgset" text="%t"/>
405 <l:template name="msgsub" text="%t"/>
406 <l:template name="note" text="%t"/>
407 <l:template name="orderedlist" text="%t"/>