100+ results for 'gsub'

Not the results you expected?

BinaryNullableSubtractTests.cs (https://gitlab.com/0072016/0072016-corefx-) C# · 330 lines

91

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 }

104

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 # ]

599

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

294 # Returns the alias name String

295 def default_alias_name

296 name.downcase.gsub(/\s/, '-')

297 end

298

snippets_controller_spec.rb (https://gitlab.com/klml/gitlab-ee) Ruby · 325 lines

275 end

276

277 let(:formatted_content) { content.gsub(/\r\n/, "\n") }

278

279 context 'CRLF line ending' do

validate_numericality_of_matcher.rb (https://github.com/BillTheBest/sms.git) Ruby · 214 lines

153

154 message << NUMERIC_COMPARISIONS.map do |key|

155 @options[key] ? "#{key.to_s.gsub('_', ' ')} #{@options[key]} " : nil

156 end.compact.join('or ')

157

ocaml.rb (https://github.com/nakao/langscan.git) Ruby · 298 lines

51

52 def denormalize(str)

53 str.gsub(/([^\\])\\o/,'\1'+"\n")

54 end

55

properties.spform.php (https://github.com/BobRay/SPForm.git) PHP · 661 lines

340 ),

341 array(

342 'name'=>'logSubjectLen',

343 'desc'=>'spf_logsubjectlen_desc',

forums.lua (http://facepunch-lua-sdk.googlecode.com/svn/trunk/) Lua · 261 lines

168 retForum.forumID = tonumber( forumID )

169

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 )

173

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

30 END

31

32 ORDER_BY_CV = ORDER_BY.gsub(/\.id = contents\./, '.id = cv.').freeze

33

34 DATA = "(CASE WHEN (content_types.mime_type_id NOT IN (SELECT id FROM mime_types WHERE code LIKE 'text/%')) THEN '' ELSE convert_from(contents.data, 'UTF8') END)".freeze

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;

28

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

162

163 @document_domain = request.host

164 @document_domain.gsub('http://', '')

165 @document_domain.gsub('https://', '')

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)

56

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

181 }

182

183 div#cgit table.list td.logsubject {

184 font-family: monospace;

185 font-weight: bold;

association_matcher.rb (https://github.com/cavneb/remarkable.git) Ruby · 283 lines

141 def interpolation_options

142 options = {}

143 options[:macro] = Remarkable.t(@macro, :scope => matcher_i18n_scope, :default => @macro.to_s.gsub("_", ""))

144 options[:options] = @options.inspect

145

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

16 local get_size_ptr = base.get_size_ptr

17 local setmetatable = setmetatable

18 local gsub = ngx.re.gsub

19 local lower = string.lower

20 local rawget = rawget

66 local req_headers_mt = {

67 __index = function (tb, key)

68 return rawget(tb, (gsub(lower(key), '_', '-', "jo")))

69 end

70 }

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

37 lfh.file_name_length = #filename

38 lfh.extra_field_length = 0

39 lfh.file_name = filename:gsub("\\", "/")

40 lfh.external_attr = 0 -- TODO properly store permissions

41 self.in_open_file = true

Subtypes2Test.java (https://gitlab.com/essere.lab.public/qualitas.class-corpus) Java · 339 lines

106 }

107

108 public void testStringSubtypeOfObject() throws Throwable {

109 executeFindBugsTest(new RunnableWithExceptions(){

110 /* (non-Javadoc)

119 }

120

121 public void testStringSubtypeOfSerializable() throws Throwable {

122 executeFindBugsTest(new RunnableWithExceptions(){

123 /* (non-Javadoc)

225 }

226

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

25 # windows match: "--- /dev/null\tTue Oct 16 18:04:34 2012"

26 def remove_os_differences(diff)

27 diff = diff.gsub(/([+-]{3}.*)\t.*/, '\1 DATE')

28 diff.gsub(/^@@ -\d(,\d)? \+\d(,\d)? @@/, "CONTEXT_LINE_NUMBERS")

marc_document.rb (https://github.com/rsinger/The-Visible-Kilgour.git) Ruby · 316 lines

35 def normalize_lccn(marc)

36 lccn = marc['010']['a']

37 lccn.gsub(/\s/,'')

38 end

39

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

344 local _, _, dir = string.find(line, "^[a-z]+%s+(.+)$")

345 if dir then

346 dir = string.gsub(dir, "\\", "/")

347 if not string.find(dir, "/$") then dir = dir .. "/" end

348 basedir = dir

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."},

147

150

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"},

154

collection.rb (https://github.com/palladius/lovd-by-less.git) Ruby · 142 lines

111 super unless method.to_s[/^each_with_.*/]

112

113 each_with_attribute method.to_s.gsub(/^each_with_/, ''), &block

114 end

115

test_zenweb_plugins_markdown.rb (https://github.com/seattlerb/zenweb.git) Ruby · 298 lines

294 class String

295 def cleanup indent = 4

296 self.gsub(/^\ {#{indent}}/, '').chomp

297 end

298 end

scancode.rb (https://github.com/vishvananda/veewee.git) Ruby · 114 lines

80

81 keycodes=''

82 thestring.gsub!(/ /,"<Spacebar>")

83

84 until thestring.length == 0

sallie_mae.rb (https://github.com/pgsql/spree.git) Ruby · 144 lines

96 def parse(body)

97 h = {}

98 body.gsub!("<html><body><plaintext>", "")

99 body.

100 split("\r\n").

user_reference_filter.rb (https://gitlab.com/vilhelmen/gitlab-ce) Ruby · 151 lines

19 # Returns a String replaced with the return of the block.

20 def self.references_in(text)

21 text.gsub(User.reference_pattern) do |match|

22 yield match, $~[:user]

23 end

location.rb (https://bitbucket.org/pcmyers/active_shipping.git) Ruby · 137 lines

115

116 def to_s

117 prettyprint.gsub(/\n/, ' ')

118 end

119

zonefile.rb (https://github.com/zarqman/dns-zonefile.git) Ruby · 315 lines

81 c = <<-MTH

82 def #{attrib}=(val)

83 @#{attrib} = val.gsub('@', @vars['origin'])

84 end

85 MTH

96 @#{attrib} = @vars[:last_host]

97 else

98 @#{attrib} = val.gsub('@', @vars['origin'])

99 end

100 end

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

53

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

58

Money.lua (https://github.com/ELLIOTTCABLE/Warcrack.git) Lua · 232 lines

216 function TSMAPI:UnformatTextMoney(value)

217 -- remove any colors

218 value = gsub(value, "|cff([0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])", "")

219 value = gsub(value, "|r", "")

custom_field_steps.rb (https://gitlab.com/MichelZuniga/openproject) Ruby · 117 lines

34

35 Given /^the following (user|issue|work package) custom fields are defined:$/ do |type, table|

36 type = (type.gsub(' ', '_') + '_custom_field').to_sym

37

38 as_admin do

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 }

67

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 }

80

81 UseWindowingSubsystem(() => windowingSubsystemAttribute.InitializationType

82 .GetRuntimeMethod(windowingSubsystemAttribute.InitializationMethod, Type.EmptyTypes).Invoke(null, null),

83 windowingSubsystemAttribute.Name);

84

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

25 </div>

26 <div class="col-md-8 offset-md-2">

27 <form name="form" role="form" (ngSubmit)="register()" #registerForm="ngForm">

28 <div class="form-group">

29 <label class="form-control-label" for="login" jhiTranslate="global.form.username">Username</label>

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

75 void setCurrentDate(long currentDate);

76 String getSubprojectOf();

77 long getReferringSubprojectTaskDependencyDate();

78 long getEarliestStartingTask();

79 long getLatestFinishingTask();

luat-cod.lua (https://bitbucket.org/preining/tex-live.git) Lua · 169 lines

7 }

8

9 local match, gsub, find, format = string.match, string.gsub, string.find, string.format

10

11 local texconfig, lua = texconfig, lua

34

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

81

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

58

59 def strip_url(url)

60 url.gsub(/\Ahttps?:\/\//, '')

61 end

62

0001-Revise-Makefile.patch (https://gitlab.com/jiangming1399/packages) Patch · 135 lines

42 -ifneq (, $(findstring mingw, $(SYS)))

43 -# Do mingw things

44 -V = $(shell lua -e "v=string.gsub('$(LUAV)','%.','');print(v)")

45 -LDFLAGS = -mwindows -lcrypt32 -lssl -lcrypto -lws2_32 $(PREFIX)/bin/lua$(V).dll

46 -LUA_CFLAGS = -DLUA_LIB -DLUA_BUILD_AS_DLL -I$(PREFIX)/include/

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"

46

47 lfs.chdir(fulljoin(os.getenv('PROJECT_DIR'), '..', 'Angel', 'Scripting', 'EngineScripts'):gsub('"', ''))

48

49 function building_for_iphone()

80 end

81

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

145 xName = idName.id2name

146

147 self[xName.gsub( /=$/, "" )]=args[0]

148 end

149

Makefile (https://gitlab.com/unofficial-mirrors/openshift-source-to-image) Makefile · 142 lines

131

132 help: ## this help

133 @awk 'BEGIN {FS = ":.*?## "} /^[a-z A-Z_-]+:.*?## / {gsub(" ",",",$$1);gsub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-21s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

134

135 vendor-in-container:

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

49 <FN>Alice in Wonderland</FN>

50 </vCard>

51 </iq>}.strip.gsub(/\n|\s{2,}/, ''))

52 @stream.expect(:write, nil, [expected])

53

76 <FN>Mad Hatter</FN>

77 </vCard>

78 </iq>}.strip.gsub(/\n|\s{2,}/, ''))

79 @stream.expect(:write, nil, [expected])

80

references.rb (https://github.com/peter-murach/github.git) Ruby · 150 lines

139

140 def validate_reference(ref)

141 refs = (ref =~ (/^(\/)?refs.*/) ? ref : "refs/#{ref}").gsub(/(\/)+/, '/')

142 refs.gsub!(/^\//, '')

index2.html (https://github.com/jataggart/keg-server.git) HTML · 128 lines

91 <b>On Tap: </b>

92 <div id="kegImage"></div>

93 <div class="kegSubDeets" style="width:200px;">

94 <div id="kegTitle" style="font-weight: bold;"></div>

95 <b>Installed:</b>

known_hosts.rb (https://github.com/tecknicaltom/metasploit-framework.git) Ruby · 132 lines

124 return

125 File.open(source, "a") do |file|

126 blob = [Net::SSH::Buffer.from(:key, key).to_s].pack("m*").gsub(/\s/, "")

127 file.puts "#{host} #{key.ssh_type} #{blob}"

128 end

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

131 row, ":", lines[row], "\n",

132 paste0(rep.int(" ", nchar(as.character(row)) + 1), collapse = ""),

133 gsub(perl = TRUE, "[^\\s]", " ", substr(lines[row], 1, col-1)), "^"

134 ))

135 }

rake_task.rb (https://github.com/cloudspokes/cs-website.git) Ruby · 179 lines

147 FileList[ ENV['SPEC'] ]

148 else

149 FileList[ pattern ].map { |f| f.gsub(/"/, '\"').gsub(/'/, "\\\\'") }

150 end

151 end

_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

154 else

155 if v.matchfunc ~= nil then

156 text = text:gsub(v.pattern, v.matchfunc)

157 else

158 debug("ERROR", v.pattern)

185

186 if (mt[k]) then

187 text = text:gsub(k, mt[k])

188 else

189 debug("ERROR", k)

193

194 -- for k,v in pairs(mt) do

195 -- text = text:gsub(k, v)

196 -- mt[k] = nil

197 -- end

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

129 def esr9_format(reference_code)

130 # Drop all leading zeroes

131 reference_code.gsub!(/^0*/, '')

132

133 # Group by 5 digit blocks, beginning at the right side

134 reference_code.reverse.gsub(/(.....)/, '\1 ').reverse

135 end

136

resource.rb (https://github.com/dickeyxxx/active_admin.git) Ruby · 159 lines

95 if controller.resources_configuration[:self][:route_collection_name] ==

96 controller.resources_configuration[:self][:route_instance_name]

97 route = route.to_s.gsub('_path', '_index_path').to_sym

98 end

99

creator.rb (https://github.com/tychobrailleur/rawr.git) Ruby · 131 lines

13 manifest_path = File.join metainf_dir_path, 'MANIFEST.MF'

14

15 lib_dirs = options.classpath.map {|cp| cp.gsub('../', '')}

16 lib_jars = options.jars.keys.map {|key| key.to_s + ".jar"}

17 libraries = lib_dirs + lib_jars + ["."]

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))

31

32 # El tratamiento de las cabinas es mas complejo:

css.php (https://github.com/sarriaroman/PuntoUBP.git) PHP · 238 lines

135

136

137 #messages .msgsubject {

138 font-size: 120%;

139 line-height: 100%;

140 }

141

142 .msgsubject {

143 font-weight:bold;

144 }

attachment_magick_test.rb (https://github.com/marcosinger/attachment_magick.git) Ruby · 133 lines

71

72 grids.keys.each do |key|

73 assert_equal grids[key][:width], grid_system.search(".#{key} p").first.inner_html.gsub(/\D/, "").to_i if key.to_s.include?("grid")

74 end

75 end

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

17

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

35

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?

51

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

143 options[:class] ||= ""

144 path = (params[:path]||[]).dup

145 name = tag.name.gsub(' ','+')

146 if path.delete(name)

147 options[:class] += ' invert'

reg_backend_shares.c (https://github.com/theuni/XBMC-deps.git) C · 164 lines

67 *********************************************************************/

68

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 *********************************************************************/

136

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 * &lt;element name="RedirectRequired" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>

26 * &lt;element name="Note" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>

27 * &lt;element name="MsgSubID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>

28 * &lt;element name="SuccessPageRedirectRequested" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>

29 * &lt;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;

196

197 /**

198 * Gets the value of the msgSubID property.

199 *

200 * @return

user.rb (https://github.com/galetahub/sunrise-core.git) Ruby · 158 lines

149 unless email.blank?

150 tmp_login = email.split('@').first

151 tmp_login.parameterize.downcase.gsub(/[^A-Za-z0-9-]+/, '-').gsub(/-+/, '-')

152 end

153 end

merger.rb (https://github.com/alovak/merge_db.git) Ruby · 190 lines

162 def backup_column_name(name)

163 if name =~ /id$/

164 name = name.gsub(/id$/, "_id")

165 else

166 name

169

170 def normalize_column_name(name)

171 name.gsub(/__id$/, '_id')

172 end

173

resource_platform_map.rb (https://github.com/jkeiser/chef.git) Ruby · 151 lines

38 if platform.kind_of?(String)

39 platform.downcase!

40 platform.gsub!(/\s/, "_")

41 platform_sym = platform.to_sym

42 end

pager.rb (https://github.com/rwaldhoff/dm-pagination.git) Ruby · 193 lines

184 def uri_for page

185 case @uri

186 when /\b#{@page_param}=/ ; @uri.gsub /\b#{@page_param}=\d+/, "#{@page_param}=#{page}"

187 when /\?/ ; @uri += "&#{@page_param}=#{page}"

188 else ; @uri += "?#{@page_param}=#{page}"

standardfilters.rb (https://github.com/peertransfer/liquid.git) Ruby · 244 lines

67

68 def strip_html(input)

69 input.to_s.gsub(/<script.*?<\/script>/, '').gsub(/<.*?>/, '')

70 end

71

72 # Remove all newlines from the string

73 def strip_newlines(input)

74 input.to_s.gsub(/\n/, '')

75 end

76

106 # Replace occurrences of a string with another

107 def replace(input, string, replacement = '')

108 input.to_s.gsub(string, replacement)

109 end

110

CreateChildSiteInputParametersChecker.java (https://github.com/shroggle/Shroggle.git) Java · 129 lines

123 if (!StringUtil.isNullOrEmpty(domainName)) {

124 if (!UrlValidator.isSystemSubDomainValid(domainName)) {

125 throw new WrongSubDomainNameException(international.get("enterCorrectDomainName"));

126 }

127 }

issues_helper_spec.rb (https://gitlab.com/artofhuman/gitlab-ce) Ruby · 188 lines

8 describe "url_for_issue" do

9 let(:issues_url) { ext_project.external_issue_tracker.issues_url}

10 let(:ext_expected) { issues_url.gsub(':id', issue.iid.to_s).gsub(':project_id', ext_project.id.to_s) }

11 let(:int_expected) { polymorphic_path([@project.namespace, @project, issue]) }

12

be.rb (https://bitbucket.org/tduarte/hite.in.git) Ruby · 224 lines

168

169 def split_words(sym)

170 sym.to_s.gsub(/_/,' ')

171 end

172

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

102

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

168

169 # remove any leftover CRs.

170 regsub -all -- "\r" $comp_output "" comp_output

171

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

174

175 set unsupported_message [${tool}_check_unsupported_p $comp_output]

rails_refactor.rb (https://github.com/tricon/rails_refactor.git) Ruby · 189 lines

37

38 to_controller_path = "app/controllers/#{@to.underscore}.rb"

39 to_resource_name = @to.gsub(/Controller$/, "")

40 to_resource_path = to_resource_name.underscore

41

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

206 }

207 end

208 assert_equal("<?xml version=\"1.0\"?><root><![CDATA[hello world]]></root>", builder.to_xml.gsub(/\n/, ''))

209 end

210

215 cdata string

216 }

217 assert_equal("<?xml version=\"1.0\"?><root><![CDATA[hello world]]></root>", builder.to_xml.gsub(/\n/, ''))

218 end

219

database_spec.rb (https://github.com/smtrox214/echo.git) Ruby · 199 lines

47 encrypted_key = Digest::MD5.hexdigest("aoeuaoeu")

48 completed_key = Translation.hk("aoeuaoeu")

49 encrypted_key.should == Base64.decode64(completed_key).gsub(/\n/, '')

50 end

51

plugin.rb (https://gitlab.com/orvi2014/rcs-db-ext) Ruby · 274 lines

61 def const_missing const

62 id = const.to_s.

63 gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').

64 gsub(/([a-z\d])([A-Z])/,'\1_\2').

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

242

243 def test_skip_blanks

244 @data = <<-END_CSV.gsub(/^ +/, "")

245

246

templator.rb (https://github.com/bairdb/shada.git) Ruby · 252 lines

113 @tag_arr.zip(@rep_arr).each do |key, val|

114 begin

115 @html.gsub! key, val.force_encoding('UTF-8')

116 rescue => e

117 @html.gsub! key, ''

129 begin

130 html = open_template val[0]

131 @html.gsub! pattern, html

132 rescue => e

133 #puts e.message

134 @html.gsub! pattern, ''

135 end

136 end

eliza.rb (https://github.com/vishalmanohar/askjeeves.git) Ruby · 231 lines

205 if result

206 switch_viewpoint(result).inject(rule.responses.random_elt) do |sum, repl|

207 sum.gsub(repl[0], repl[1].join(" "))

208 end

209 end

ResolvedCallImpl.java (https://github.com/iamsteveholmes/kotlin.git) Java · 230 lines

124 }

125

126 public void setResultingSubstitutor(@NotNull TypeSubstitutor substitutor) {

127 resultingDescriptor = (D) candidateDescriptor.substitute(substitutor);

128 assert resultingDescriptor != null : candidateDescriptor;

filter_manager.rb (https://bitbucket.org/toihrk/fusuma.git) Ruby · 203 lines

79

80 def description

81 reject { |k, v| RSpec::Core::FilterManager::DEFAULT_EXCLUSIONS[k] == v }.inspect.gsub(PROC_HEX_NUMBER, '').gsub(PROJECT_DIR, '.').gsub(' (lambda)','')

82 end

83

call_by_name_spec.rb (https://github.com/stonegao/rewrite_rails.git) Ruby · 267 lines

6

7 def ws(str)

8 str.gsub(/\s+/, ' ')

9 end

10

ForceSFV.tcl (http://nxscripts.googlecode.com/svn/) TCL · 130 lines

63

64 proc ArgRange {list start end} {

65 regsub -all {[\s]+} $list { } list

66 return [join [lrange [split [string trim $list] { }] $start $end] { }]

67 }

87

88 proc SplitPath {path} {

89 regsub -all -- {[\\/]+} $path {/} path

90 return [file split [string trim $path "/"]]

91 }

tcl.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 458 lines

68 <KEYWORD1>string</KEYWORD1>

69 <KEYWORD1>regexp</KEYWORD1>

70 <KEYWORD1>regsub</KEYWORD1>

71 <KEYWORD1>if</KEYWORD1>

72 <KEYWORD1>else</KEYWORD1>

lua.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 235 lines

163 <KEYWORD2>string.format</KEYWORD2>

164 <KEYWORD2>string.gfind</KEYWORD2>

165 <KEYWORD2>string.gsub</KEYWORD2>

166 <KEYWORD2>table.concat</KEYWORD2>

167 <KEYWORD2>table.foreach</KEYWORD2>

ResourceLoader.cpp (https://bitbucket.org/ultra_iter/qt-vtl.git) C++ · 515 lines

356 m_handle->clearAuthentication();

357

358 m_documentLoader->cancelPendingSubstituteLoad(this);

359 if (m_handle) {

360 m_handle->cancel();

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"/>